Full reference of the SDK available in Nango functions
createSync
true
, automatically runs the sync when a new connection is created.
Otherwise, it needs to be triggered via the API or Nango UI.await nango.deleteRecordsFromPreviousExecutions('modelName')
inside the sync exec
function.When trackDeletes
is set to true
, Nango automatically detects deleted records during full syncs only and marks them as deleted in each record’s metadata (soft delete). These records remain stored in the cache.When set to false
, Nango does not mark missing records as deleted, even if they weren’t returned in the latest full sync—they simply remain in the cache unchanged.Defaults to false
.onWebhook
will handle.
If a webhook type is not on the list, it will not be handled.createAction
createOnEvent
retries
and retryOn
parameters in your HTTP requests.
The following will apply:
>= 500
, 429
ECONNRESET
, ETIMEDOUT
, and ECONNABORTED
.retryOn
parameter to specify an array of additional status codes to retry on.retries
default to 0
3000ms
, the delay between attempts is multiplied by 2
each time (exponential backoff) and is capped at 10 minutes
.nango.paginate()
method takes in a ProxyConfiguration
parameter.
Use the paginate
field to of the ProxyConfiguration
to specify how the endpoint’s pagination work. Here’s an example for a Jira endpoint:
for
loop to iterate through the paginated results.
cursor
, link
or offset
with the following settings:
GET /integrations/{uniqueKey}
query parameters: documentation
Response
See GET /integrations/{uniqueKey}
response: documentation
id
field used to dedupe records.
batchDelete
is the unique id
; the other fields are ignored.
batchSave
. Nango will compare the records saved in the current execution with those from the previous execution and mark any missing records as deleted.
Parameters
Important considerations:
_metadata.deleted = true
) and remain in the cacheid
field is required in each record and used to determine what existing record to merge into.
batchUpdate
is primarily useful in webhook sync functions, where you receive partial updates from a webhook and want to merge them into the existing records.
The merge algorithm used is a deep merge. Nested objects are merged recursively, while arrays always use the new value for the array. Any fields not present in the update record are left unchanged.
Take special care when using batchUpdate with records containing arrays.
The merge algorithm does not attempt to merge arrays, but rather always uses the value of the new array.
nango.batchUpdate()
, which performs a deep merge. Note that nango.batchUpdate()
is more performant than using nango.getRecordsById()
, followed by nango.batchSave()
.A common use case is when handling external webhooks, where only a partial update of a record is received from an API.nango.variant
property.
ActionError
ActionError
in an action function to return a descriptive error to your app when needed:
nango-integrations
directory and can be imported in the following way: