Skip to main content
1

Sign up and create an integration

Sign up for Nango — it’s free, no credit card required.Once you’re in, go to the Integrations tab and click Add integration. Choose a provider from the 700+ supported APIs (for example, GitHub, Slack, or HubSpot), give your integration a unique ID, and save it.
Your integration ID is called providerConfigKey in the SDK. You’ll use it in every API call.
2

Authorize the API (create a connection)

Go to the Connections tab and click Add connection. Select your integration, enter a connection ID (any string that identifies this user, e.g. user-123), and complete the auth flow.This creates a connection — a stored set of credentials for one user and one API. Later, you’ll embed this same flow in your product:
// In your frontend — opens Nango's managed auth UI
nango.openConnectUI({
  onEvent: (event) => {
    if (event.type === 'close') {
      // auth complete or cancelled
    }
  }
});
For the quickstart, creating the connection manually in the dashboard is enough. See the Auth guide to embed this in your product.
3

Install the Node SDK

Install the @nangohq/node package in your backend project:
npm install @nangohq/node
Your secret key is available in the Nango dashboard under Environment Settings. Store it as an environment variable — never hardcode it.
export NANGO_SECRET_KEY=your-secret-key
4

Retrieve the connection credentials

Use nango.getConnection() to fetch the stored credentials for a connection. Nango automatically refreshes OAuth tokens before returning them.
import { Nango } from '@nangohq/node';

const nango = new Nango({ secretKey: process.env.NANGO_SECRET_KEY });

const connection = await nango.getConnection(
  'github',    // your integration ID (providerConfigKey)
  'user-123'   // the connection ID you created in the dashboard
);

console.log(connection.credentials);
// { type: 'OAUTH2', access_token: '...', ... }
The credentials object contains the raw token response from the provider, including the access token.
5

Make your first authenticated API request

Use the Nango Proxy to make an authenticated request on behalf of your user. Nango injects the credentials, handles retries, and returns the response — you never touch the raw token.
import { Nango } from '@nangohq/node';

const nango = new Nango({ secretKey: process.env.NANGO_SECRET_KEY });

const response = await nango.get({
  endpoint: '/user',                // GitHub's "get the authenticated user" endpoint
  providerConfigKey: 'github',      // your integration ID
  connectionId: 'user-123'          // the connection to use
});

console.log(response.data);
// { login: 'octocat', id: 1, name: '...', ... }
You can also use nango.post(), nango.put(), nango.patch(), and nango.delete() for other HTTP methods.You’re now making authenticated API requests on behalf of your users.
6

Next steps

Embed auth in your app

Let your users connect external APIs from within your product.

Use the Proxy

Make authenticated requests to any API without handling credentials.

Build with Functions

Write TypeScript functions to sync data, handle webhooks, and run actions.

Try the AI builder

Describe your use case and get production-ready integration code.
Questions or problems? Join the Nango Slack community — the team responds quickly.

Build docs developers (and LLMs) love