How to implement an event handler
Step 1 - Initial Functions setup
If you don’t have anango-integrations
folder yet, follow the initial Functions setup guide first.
Otherwise, you can skip to the next step.
Step 2 - Create your event function file
Create a new file in your integration’s folder, which should be nested unser yournango-integrations
folder.
For example, if you want to react to an event in your salesforce
integration, your folder structure should look like this:
setup.ts
exec
function kicks off when the associated event occurs.
Also import your new event file in your index.ts
file:
index.ts
Step 3 - Implement the event function
Implement your handler logic in theexec
function.
The following can help you with your implementation:
nango
object reference to understand the SDK methods available in event functions- Our reference implementations repo has many examples of event handlers. Search for
onEvent(
. - Leveraging AI agents guide to build actions with claude code, cursor & other AI agents
Step 4 - Deploy your integrations
To run your event function in Nango, you need to deploy it to an environment in your Nango account. To deploy all integrations in yournango-integrations
folder, run:
Questions, problems, feedback? Please reach out in the Slack community.