Installing & instantiating the node SDK
Install it with your favorite package manager, e.g.:Nango class:
- Nango Cloud
- Localhost
- Self-hosted
Auth
Retrieve API credentials
Nango stores API credentials in connections objects. Retrieve a connection with:nango.getConnection() method returns the necessary information authenticate API requests:
- OAuth 2: fresh access token
- OAuth 1: token & token secret
- API key: API key
- Basic: username and password
Example Response
List all connections for a user
List all connections
Delete a connection
Set, update or fetch custom Metadata
Nango lets you store custom metadata on the Connection.updateMetadata updates existing Metadata for the connection by merging with any existing Metadata.
setMetadata overrides any existing Metadata for the connection.
Retrieve integration details
Use this method to retrieve all the details Nango stores on a specific integration:Sync
Proxy
Some APIs are not yet fully-configured to work with the Proxy and require you to indicate the base URL.You can check if your API contains the Feel free to contribute the
proxy.base_url field in the providers.yaml configuration file.If not, you need to add a baseUrlOverride field in your call to the Proxy as follow:proxy.base_url field to any API in the providers.yaml public file, or reach out on the Slack community to ask us to do it.The base URL should already be set for you for each API, but you can override with the
baseUrlOverride field.Some APIs don’t have a default base URL (because it hasn’t been configured in Nango or they have multiple ones). You can check this by looking at the proxy.base_url field in the providers.yaml configuration file. Feel free to contribute this field or reach out on the Slack community to ask us to do it.nango.get({}), nango.post({}), nango.patch{{}} and nango.delete({}).
Return valueWhen you call the proxy, Nango creates the API request to the external API and runs it for you (possibly with retries). The response from the external API is passed back to you exactly as Nango gets it:
- Response code
- Response headers
- Response body
Trigger syncs
You can trigger specific sync(s) for a connection:Start/pause syncs
Starts or pauses the continuous execution of specified sync(s) for a given connection.Sync status
Returns the status of syncs given an integration, sync names, and an optional connection idRead synced data
To read synced data from Nango, uselistRecords:
delta parameter.
The value from the next_cursor property can be used with the cursor parameter to get the next page of results.
If there are no more results, the next_cursor will be null.
Trigger an action
To trigger an action, use:Get environment variables
To get the environment variables from a sync script, you can usegetEnvironmentVariables: