Guide on how to build a custom integration in Nango.
nango-integrations
. Whether located in your main codebase or a dedicated repository, this folder should be version-controlled.
To initialize your integrations folder (e.g. at the root of your repository), run:
./nango-integrations
folder with some initial configuration and an example
sync script. The nango-integrations
directory looks like this:
.env
file in ./nango-integrations
, add the following environment variables:
Production
and Development
environment in the left nav bar).
Learn more about the Nango CLI (reference).
./nango-integrations/salesforce/syncs/
.
exec
method with your integration code. In the example here, we fetch tasks from Salesforce:
nango.lastSyncDate
is the last date at which the sync has runawait nango.batchSave()
to persist external data in Nango’s cacheawait nango.get()
to perform an API request (automatically authenticated by Nango)await nango.log()
to print console logs (replaces console.log()
)index.ts
file:
./nango-integrations/salesforce/actions/
.
exec
method with your integration code. In the example here, we fetch available contact fields from Salesforce:
await nango.get()
to perform an API request (automatically authenticated by Nango)await nango.log()
to print console logs (replaces console.log()
)return
will synchronously return results from the action trigger requestindex.ts
file:
dryrun
function of the CLI (reference):
dryrun
retrieves connections from your Dev
environment.