The sample app is a practical demonstration of integrating Nango in your codebase. It contains:

  • A frontend: lets users connect an integration using the Nango frontend SDK.
  • A backend: listens to Nango webhooks and consumes the Nango API to read & write data.

The sample app uses Slack as an example integration and is showcased in this demo video.

Access the repository

NangoHQ/sample-app

Run the sample app

1

Create an account

  • Go to nango.dev and create an account (free).
2

Create a Slack integration

  • Go to Integrations ans create a Slack integration.
  • Go to Slack Dev Center and create a Slack OAuth app with Bot Token Scopes:
    • users:read
    • chat:write
  • Go back to Nango. In the “Authorization” tab, add credentials in the Slack integration in the Authorization tab. In the “Endpoints” tab, activate endpoint GET /users and POST /send-message.
3

Prepare your env

  • Install: NodeJS, Docker. Then run:
git clone https://github.com/NangoHQ/sample-app.git

cd sample-app

nvm use
npm i
  • Copy your Nango Secret Key, found in Environment Settings.
  • Create a file to store environment variables and fill in the Nango Secret Key:
cp .env.example .env
4

Transfer Nango webhooks locally

  • This command should be running at all time:
npm run webhooks-proxy
  • Copy the URL the command gave you and go to Environment Settings. Set Webhook URL to ${URL}/webhooks-from-nango, e.g: https://tame-socks-warn.loca.lt/webhooks-from-nango.
5

Launch

  • Run:
npm run start
6

Bonus: Deploy custom scripts

This above sample app uses pre-built integrations, but you can also use custom ones.

  • Set up the Nango CLI:
npm install -g nango
cd nango-integrations/
nango init
  • Add your Nango Secret Key in NANGO_SECRET_KEY_PROD in ./nango-integrations/.env.
  • Optionalyl customize the integration using this guide.
  • Deploy the custom integration:
nango deploy prod

Questions, problems, feedback? Please reach out in the Slack community.