The Nango SDK is rate-limited to prevent abuse and ensure fair usage across all clients. The rate limit is enforced on a per-account basis, with a fixed window of time and a maximum number of requests allowed within that window.
If a client exceeds the rate limit, the API will respond with a 429 Too Many Requests status code. In this case, the Retry-After header is included, indicating the number of seconds the client should wait before making another request to avoid being rate-limited.
To handle rate limiting gracefully, clients should monitor for the 429 status code and honor the Retry-After header value provided in the response.
// Example:try{const res =await nango.listIntegrations();...}catch(err){if(err.response.status===429){const retryAfter = err.response.headers['retry-after'];// wait and retry...}...}
Defaults to false. If false, the token will only be refreshed if it expires within 15 minutes. If true, a token refresh attempt will happen on each request. This is only useful for testing and should not be done at high traffic.
Defaults to false. If false, the refresh token is not included in the response, otherwise it is. In production, it is not advised to return the refresh token, for security reasons, since only the access token is needed to sign requests.
Example Response
{"id":18393,"created_at":"2023-03-08T09:43:03.725Z","updated_at":"2023-03-08T09:43:03.725Z","provider_config_key":"github","connection_id":"1","credentials":{"type":"OAUTH2","access_token":"gho_tsXLG73f....","refresh_token":"gho_fjofu84u9....","expires_at":"2024-03-08T09:43:03.725Z","raw":{// Raw token response from the OAuth provider: Contents vary!"access_token":"gho_tsXLG73f....","refresh_token":"gho_fjofu84u9....","token_type":"bearer","scope":"public_repo,user"}},"connection_config":{"subdomain":"myshop","realmId":"XXXXX","instance_id":"YYYYYYY"},"account_id":0,"metadata":{"myProperty":"yes","filter":"closed=true"}}
[{"providerConfigKey":"demo-github-integration","syncs":[{"name":"github-issue-example","type":"sync","models":[{"name":"GithubIssue","fields":[{"name":"id","type":"integer"},{"name":"owner","type":"string"},{"name":"repo","type":"string"},{"name":"issue_number","type":"number"},{"name":"title","type":"string"},{"name":"author","type":"string"},{"name":"author_id","type":"string"},{"name":"state","type":"string"},{"name":"date_created","type":"date"},{"name":"date_last_modified","type":"date"},{"name":"body","type":"string"}]}],"sync_type":"FULL","runs":"every half hour","track_deletes":false,"auto_start":false,"last_deployed":"2024-02-28T20:16:38.052Z","is_public":false,"pre_built":false,"version":"4","attributes":{},"input":{},"returns":["GithubIssue"],"description":"Fetches the Github issues from all a user's repositories.\nDetails: full sync, doesn't track deletes, metadata is not required.\n","scopes":["public_repo"],"endpoints":[{"GET":"/github/issue-example"}],"nango_yaml_version":"v2","webhookSubscriptions":[]}],"actions":[{"name":"fetch-issues","type":"action","models":[{"name":"GithubIssue","fields":[{"name":"id","type":"integer"},{"name":"owner","type":"string"},{"name":"repo","type":"string"},{"name":"issue_number","type":"number"},{"name":"title","type":"string"},{"name":"author","type":"string"},{"name":"author_id","type":"string"},{"name":"state","type":"string"},{"name":"date_created","type":"date"},{"name":"date_last_modified","type":"date"},{"name":"body","type":"string"}]}],"runs":"","is_public":false,"pre_built":false,"version":"4","last_deployed":"2024-02-28T20:16:38.052Z","attributes":{},"returns":["GithubIssue"],"description":"","scopes":[],"input":{},"endpoints":[{"GET":"/github/issues"}],"nango_yaml_version":"v2"}],"postConnectionScripts":[],"provider":"github"}]
importtype{ ModelName }from'<path-to-nango-integrations>/models'const records =await nango.listRecords<ModelName>({ providerConfigKey:'<INTEGRATION-ID>', connectionId:'<CONNECTION-ID>', model:'<MODEL-NAME>'});
nango.getRecords() is deprecated and will be removed in future releases as it does not support efficient pagination. Please use nango.listRecords() detailed below.
DEPRECATED (use modifiedAfter) Timestamp, e.g. 2023-05-31T11:46:13.390Z. If passed, only records modified after this timestamp are returned, otherwise all records are returned.
Example Response
This endpoint returns a list of records, ordered by modification date ascending. If some records are updated while you paginate through this endpoint, you might see these records multiple times.
{ records:[{ id:123, ...,// Fields as specified in the model you queried _nango_metadata:{ deleted_at:null, last_action: 'ADDED', first_seen_at: '2023-09-18T15:20:35.941305+00:00', last_modified_at: '2023-09-18T15:20:35.941305+00:00', cursor: 'MjAyNC0wMi0yNlQwMzowMDozOS42MjMzODgtMDU6MDB8fGVlMDYwM2E1LTEwNDktNDA4Zi05YTEwLTJjNzVmNDkwODNjYQ=='}}, ...], next_cursor:"Y3JlYXRlZF9hdF4yMDIzLTExLTE3VDExOjQ3OjE0LjQ0NyswMjowMHxpZF4xYTE2MTYwMS0yMzk5LTQ4MzYtYWFiMi1mNjk1ZWI2YTZhYzI"}
const res =await nango.get({endpoint:'/endpoint',providerConfigKey:'<INTEGRATION-ID>',connectionId:'<CONNECTION-ID>',baseUrlOverride:'https://base-url.com'});
const res =await nango.post({endpoint:'/endpoint',providerConfigKey:'<INTEGRATION-ID>',connectionId:'<CONNECTION-ID>',baseUrlOverride:'https://base-url.com'});
const res =await nango.put({endpoint:'/endpoint',providerConfigKey:'<INTEGRATION-ID>',connectionId:'<CONNECTION-ID>',baseUrlOverride:'https://base-url.com'});
const res =await nango.patch({endpoint:'/endpoint',providerConfigKey:'<INTEGRATION-ID>',connectionId:'<CONNECTION-ID>',baseUrlOverride:'https://base-url.com'});
const res =await nango.delete({endpoint:'/endpoint',providerConfigKey:'<INTEGRATION-ID>',connectionId:'<CONNECTION-ID>',baseUrlOverride:'https://base-url.com'});