This repository provides a practical demonstration of integrating Nango into your codebase. It includes Syncs scripts, a backend API for managing Nango's webhooks, and a straightforward frontend for user interaction and data retrieval.
-
Folder back-end To integrate with Nango you need a backend that will listen to Nango’s webhooks and interact with our API.
-
Folder front-end Finally to let your user connect to your integration you need a frontend and call to our auth library.
-
Folder nango-integrations Optional To use Nango you need some scripts to manipulate the data. We provide templates for most providers but you can also use custom scripts. This folder, setup with our CLI, contains the scripts that will fetch your users’ data.
To use this demo you will need:
- Go to nango.dev
- Create an account, it's free!
- Go to Integrations Page
- Create an integration > Slack
- Then go to Slack Dev Center
- Create a Slack OAuth app with Bot Token Scopes
users:read
chat:write
- Go back to Nango:
- Add credentials in the integration
- Activate endpoint
GET /users
- Activate endpoint
POST /send-message
Install: NodeJS
, Docker
git clone https://github.com/NangoHQ/sample-app.git
cd sample-app
nvm use
npm i
- Add your Nango Secret Key, you can find it in Environment Settings
cp .env.example .env
- This command should be running at all time
npm run webhooks-proxy
- Copy the URL the command gave you
- Go to Environment Settings
- Set Webhook URL to
${URL}/webhooks-from-nango
, e.g:https://tame-socks-warn.loca.lt/webhooks-from-nango
Note
If that doesn't work, you can use ngrok
npm run start
Go to: https://localhost:3000
This demo use templates by default, but you can also use custom scripts
# Setup nango
npm install -g nango
cd nango-integrations/
nango init
# Add your Nango Secret Key in NANGO_SECRET_KEY_PROD
code .env
# Change and deploy
nango deploy prod