Function types
Syncs
Continuously fetch and cache data from external APIs on a schedule. Ideal for keeping a local copy of contacts, files, or any external records up to date.
Actions
On-demand functions that write data or execute operations on external APIs. Triggered explicitly from your backend and return a typed result.
Webhook processing
Handle incoming webhooks from external APIs reliably. Nango routes, deduplicates, and attributes each webhook to the right connection.
Proxy
Make authenticated API requests without managing credentials. Nango injects auth, retries, and logs every call automatically.
How functions work
nango object is the runtime SDK available inside every function. It provides authenticated HTTP methods, logging, metadata storage, checkpointing, and more — all scoped to the connection the function is executing for.
The function lifecycle
Write
Create a TypeScript file in your
nango-integrations folder. Use createSync or createAction to define your function with typed inputs, outputs, and configuration.Test
Run
nango dryrun <function-name> <connection-id> to execute your function locally against a real connection. Data is printed to the console without being persisted.Deploy
Run
nango deploy dev to deploy your functions to Nango. Most teams automate this step in CI/CD.Built-in capabilities
Authenticated API access
Every function receives anango object pre-bound to the current connection. Call nango.get(), nango.post(), nango.put(), nango.patch(), or nango.delete() and credentials are injected automatically — including OAuth token refresh.
Retries and rate-limit handling
Passretries: N to any proxy call and Nango retries with exponential backoff. Rate-limit responses (429s) are handled transparently.
Storage
Syncs write records to Nango’s encrypted cache usingnango.batchSave(). Records are change-tracked: Nango detects additions, updates, and deletes, then notifies your backend via webhook.
Checkpoints
Save progress mid-execution withnango.saveCheckpoint() and resume from the same point on the next run. This makes long-running syncs resilient to failures without re-fetching everything.
Observability
All function executions and individual API requests are logged. Usenango.log() to emit custom messages. Logs are visible in the Nango dashboard and exportable via OpenTelemetry.
Connections and functions
Each function execution is scoped to a single connection. A connection represents one user’s credentials for a given integration (e.g., a specific GitHub account linked to your app). When Nango runs a sync, it runs the same function code once per connection, keeping customer data fully isolated.Setup
Initialize your integrations folder
nango-integrations/ directory with an example sync and initial configuration. Commit this folder to version control.Authenticate the CLI
Add your secret keys to Get your secret keys from Environment Settings in the Nango dashboard.
nango-integrations/.env:Next steps
AI builder
Generate integration code from a plain-language description of what you want to build.
Syncs
Build a continuously running function that fetches and caches external API data.
Actions
Build an on-demand function that writes data or triggers operations on external APIs.
Proxy
Make ad-hoc authenticated API requests without deploying a function.