This is a collection of helper methods that the IntegryJS
global provides. You can install the library on the server as well as the client to get access to these.
integryJS(appKey, hash, userID, xIntegryConfig, options?)
Parameter | Required | Type | Description |
appKey | Yes | String | This uniquely identifies your app in Integry. You can find it in Account Settings > Security. |
hash | Yes | String | This is calculated using the User ID and App Secret to authenticate the SDK widget with Integry's servers. While it can be calculated client-side using a helper function, it's best that you calculate it server-side after a user logs in to your app, and return the hash via API endpoint (along with the App Key and User ID) for security. |
userID | Yes | String | We simply use whatever unique ID string you pass in this field to associate, and return, flow integrations that a user sets up. We don't assign any additional credentials to your users. |
xIntegryConfig | Yes | Object | |
options | No | Object |
xIntegryConfig
Property | Type | Description |
appAuth | Object |
appAuth
Property | Type | Description |
apiKey | String |
API calls from Integry to your app can be authenticated using this key. We will pass it in the header or parameters. If you don't support user-specific API keys, you can hardcode an Integry-specific key. You can also pass extra values to ID the user, campaign, etc. |
extras | Object | Include any additional properties you want to pass along with the apiKey. |
options
Property | Type | Description |
title | String | |
tags | Array | |
objects | Object |
getAuthHash()
Used in a testing environment to calculate the hash used before attempting to authenticate with Integry APIs.
IntegryJS.Helpers.getAuthHash(userId, appSecret): string;
Name | Type | Required | Description |
---|---|---|---|
userId | string | ✅ | ID of the user you are authenticating against |
appSecret | string | ✅ | App Secret |
init(options?)
Parameter | Required | Type | Description |
options | No | Object |
options
Property | Type | Description |
containerId | String | Add the DOM container ID where you want to render the marketplace. |
appId | String | |
showApps | Boolean | Add this flag if you want to group Flows by App. |
renderMode | Constant |
You can show the marketplace landing page in a modal/popup (set to IntegryJS.RenderModes.MODAL) or in-line (set to IntegryJS.RenderModes.INLINE). Defaults to in-line. |
renderAppPageMode | Constant | You can show the app page in the marketplace in a modal/popup (set to IntegryJS.RenderModes.MODAL) or in-line (set to IntegryJS.RenderModes.INLINE). Defaults to in-line. |
renderFlowSetupMode | Constant | You can show the integration setup pages in the marketplace in a modal/popup (set to IntegryJS.RenderModes.MODAL) or in-line (set to IntegryJS.RenderModes.INLINE). Defaults to in-line. |
viewStyle | Enum |
You can show the marketplace in a comfortable/wide format (set to IntegryJS.ViewStyles.COMFORTABLE) or a compact/narrow format (set to IntegryJS.ViewStyles.COMPACT). Defaults to comfortable. |
eventEmitter.on(event, callback function)
Call this method to subscribe to an event.
Parameter | Required | Type | Description |
event | Yes | String | You can subscribe to these events. |
callback function | Yes | Function |
Callback Function
Parameter | Required | Type | Description |
data | Yes | Object |
Data
Property | Type | Description |
flowId | Number | |
integrationId | Number | |
name | String | |
status | String | |
callbackURL | String | |
event | Enum | 'CREATE' | 'EDIT' |
renderFlowSetupForm(flowId, integrationId, flowContainerId, viewStyle)
This function is used if you want to render a specific flow setup form or open an already integration in edit mode. This method will simply render the setup form for user without requiring them to go through the Apps/Flows listing.
Parameter | Required | Type | Description |
flowId | Yes | String | This the ID of the flow that you want to render. |
integrationId | No | String | This is the ID of the integration that you want to open in edit mode. |
flowContainerId | Yes | String | This is the html container (e.g. a div) where you want to render the output of this function. |
viewStyle | String | You can show the form in a comfortable/wide format (set to IntegryJS.ViewStyles.COMFORTABLE) or a compact/narrow format (set to IntegryJS.ViewStyles.COMPACT). Defaults to comfortable. |