Integry Docs
  • Welcome
  • Sign up for a free trial
  • Apps
    • Overview
    • Authentication
      • Access Control and Testing
    • Passthrough Requests
    • Supported Apps
      • Accelo
      • Aircall
      • Constant Contact
      • Copper
      • Elastic Email
      • Fireflies
      • Insightly
      • Instantly
      • Ontraport
      • RingCentral
      • Sendy
      • ServiceTitan
      • ActiveCampaign
      • Jotform
      • ActiveTrail
      • Agile CRM
      • Aha!
      • Airtable
      • Amazon SES
      • Asana
      • Basecamp3
      • BirdSend
      • Breezy HR
      • Brevo
      • Campaign Monitor
      • Capsule CRM
      • Chargify
      • CleverReach
      • ClickUp
      • ClickSend
      • Cliengo
      • Coda
      • Constant Contact
      • ConvertKit
      • Copper
      • Customer.io
      • Delighted
      • Demio
      • Drip
      • E-goi
      • Eventbrite
      • EverAction
      • Everhour
      • Formstack
      • Freshdesk
      • Freshworks CRM
      • Mautic
      • Customer.guru
      • Front
      • FTP
      • GetResponse
      • GitHub
      • Google Contacts
      • Google Sheets
      • GoToTraining
      • Groove
      • Help Scout
      • HubSpot
      • Keap
      • Mailchimp Transactional
      • Mailjet
      • MailUp
      • MeisterTask
      • Monday.com
      • MoonMail
      • Moosend
      • Nimble
      • Notion
      • Ontraport
      • PagerDuty
      • Pipedrive
      • Pipeline
      • Salesforce
      • SendPulse
      • Slack
      • Snappy
      • SolarWinds
      • Stripe
      • SurveySparrow
      • Teamgate
      • Unbounce
      • Zoho Books
      • Zoho Campaigns
      • Zoho CRM
      • Zoho Mail
      • Zoom
  • Flows
    • Overview
    • Flow Tutorials
      • Sync data TO another app from your app
      • Sync data FROM another app to your app
      • Create a two-way flow
    • Build a Flow
    • Trigger a Flow
      • Multiple Triggers in a Flow
    • Steps in a Flow
    • Integrations
      • Runs
  • Functions
    • Overview
    • Try Functions in 60 seconds
    • Quickstart for AI
    • Viewing Function Calls
    • Source Functions
    • Agent Frameworks
      • LangChain/LangGraph
      • CrewAI
      • AutoGen
      • LlamaIndex
      • Haystack
      • Smolagent
      • LiteLLM
      • Mistral AI
  • Embedded UI
    • Embed Integry Apps Marketplace
    • Add Integry Apps to an Existing Marketplace
    • Render modes, layouts and styling
    • Embedding FAQs
  • APIs and SDKs
    • JS SDK Reference
      • React Web Apps
    • API Reference
  • Workspaces
    • Overview
    • Workspace Variables
    • User Variables
  • Users
    • Testing with Beta Users
Powered by GitBook
On this page
  • Marketplace initialized
  • Account connected​
  • Account disconnected
  • Integration created​
  • Integration enabled​
  • Integration disabled​
  • Integration renamed​
  • Integration deleted
  • Subscribe to an event
  • Unsu​bscribe from an event

Was this helpful?

Export as PDF
  1. APIs and SDKs
  2. JS SDK Reference

Events

Last updated 6 months ago

Was this helpful?

The SDK emits a number of different events when it loads, a user connects an account, sets up an integration, etc. You can leverage these events to plug in your own logic in the user journey.

Note: Events emitted by the SDK are scoped to the instance on which the eventEmitter object is configured. There is no possiblilty of naming collision with global events, or even with the same event subscribed on multiple SDK instances.

This article lists all the events that can be leveraged, and explains how to subscribe and unsubscribe to/from them.

Marketplace initialized

eventEmitter.on('ready')

Fired when the SDK finishes initialization by authorizing the client. This event is not fired if the credentials provided are incorrect.

mySDKInstance.eventEmitter.on('ready', (data) => {

});

Account connected

eventEmitter.on('did-add-authorization')

Fired when an authorization is added successfully in the flow setup form. You can use the alreadyExists key to check if a user is adding a previously connected account again.

CopymySDKInstance.eventEmitter.on('did-add-authorization', (data) => {
/**
* data:
* identity: string;
* authorizationId: number;
* flowId: number;
* alreadyExists: boolean;
*/
});

Account disconnected

Fired when an authorization is deleted in the flow setup form.

CopymySDKInstance.eventEmitter.on('did-remove-authorization', (data) => {
  /**
   * data:
   *   authorizationId: number;
   */
});

Fired when an integration is saved successfully. If a user edits an existing integration and saves it, this will fire again.

CopymySDKInstance.eventEmitter.on('did-save-integration', (data) => {
  console.log(`Hey, we set up integration ${data.integrationId} successfully!`);
  /**
   * data:
   *   flowId: number;
   *   integrationId: number;
   *   name: string; **Name of the integration**
   *   status: 'ACTIVE' | 'INACTIVE';
   *   callbackUrl: string;
   *   event:  'EDIT' | 'CREATE';
   *   flowName: string;
   *   flowDescription: string;
   *   brandingApp: {
         name: string,
         description: string,
         icon_url: string
       };
   */
});

Fired when an integration is enabled using the toggle on integrations listing screen.

CopymySDKInstance.eventEmitter.on('did-enable-integration', (data) => {
  console.log(`Hey, we enabled integration ${data.integrationId} successfully!`);
  /**
   * data:
   *   integrationId: number;
   *   name: string; **Name of the integration**
   *   status: 'ACTIVE' | 'INACTIVE';
   */
});

Fired when an integration is disabled using the toggle on integrations listing screen.

CopymySDKInstance.eventEmitter.on('did-disable-integration', (data) => {
  console.log(`Hey, we disabled integration ${data.integrationId} successfully!`);
  /**
   * data:
   *   integrationId: number;
   *   name: string; **Name of the integration**
   *   status: 'ACTIVE' | 'INACTIVE';
   */
});

Fired when an integration is renamed.

CopymySDKInstance.eventEmitter.on('did-rename-integration', (data) => {
  console.log(`Hey, we renamed integration ${data.integrationId} successfully!`);
  /**
   * data:
   *   integrationId: number;
   *   name: string; **Name of the integration**
   *   status: 'ACTIVE' | 'INACTIVE';
   */
});

Integration deleted

Fired when an integration is deleted successfully.

CopymySDKInstance.eventEmitter.on('did-delete-integration', (data) => {
  console.log(
    `Hey, we deleted integration ${data.integrationId} successfully!`,
  );
  /**
   * data:
   *   flowId: number;
   *   integrationId: number;
   */
});

Subscribe to an event

Call eventEmitter.on('<event_name>') method​ to subscribe to an event.

For example, here's how you would subscribe to the did-save-integration event to get the callback URL you need to run the integration.

CopymySDKInstance.eventEmitter.on('did-save-integration', (data) => {
  console.log(`Hey, we set up integration ${data.integrationId} successfully!`);
  /**
   * data:
   *   flowId: number;
   *   integrationId: number;
   *   name: string;
   *   status: string;
   *   callbackUrl: string;
   *   event:  'EDIT' | 'CREATE';
   */
});

Unsu​bscribe from an event

Call eventEmitter.unsub('<event_name>') method​ to unsubscribe from an event.

Here's an example:

Copyfunction integrationSavedCallback(data: CallbackData) {
  console.log(`Integration with name ${data.name} was created!`);
}
// subscribe
mySDKInstance.eventEmitter.on('did-save-integration', integrationSavedCallback);

// unsubscribe
mySDKInstance.eventEmitter.unsub('did-save-integration', integrationSavedCallback);

eventEmitter.on('did-remove-authorization')

Integration created

eventEmitter.on('did-save-integration')

Integration enabled

eventEmitter.on('did-enable-integration')

Integration disabled

eventEmitter.on('did-disable-integration')

Integration renamed

eventEmitter.on('did-rename-integration')

eventEmitter.on('did-delete-integration')

​
​
​
​
​
​
​
​
​
​
​
​
​