- Front-end integration: embed JS code in your UI
- Back-end integration: use Peliqan APIs to fetch data from your end-customers
As an alternative to embedding, you can also use the Peliqan platform UI whitelabeled. Click here for more info on whitelabel.
1. Front-end integration (embedding in your UI)
Front-end embedding is performed in 2 steps:- Fetch an
integration_tokenfor a specific end-customer. You identify the end-customer using theexternal_idwhich is your unique id for the customer. - Add JS code into your product that renders e.g. a button “Add connection”. When the button is clicked, a JS function is invoked that opens a modal, in which the user can choose and add a connection. Click here for a simplified embedding demo.
1.1 Embedding step 1: fetch an integration_token
Make a server-side API call to fetch a short-lived (30 min) integration_token for a specific end-customer using your unique customer ID (external_id in Peliqan):
POST https://app.eu.peliqan.io/api/partner/sub-account/integrate/
Note: the trailing slash at the end of the URL is required !Note: the trailing slash at the end of the URL is required !
Authorization: JWT <partner_token>Authorization: JWT <partner_token>
Request PayloadRequest Payload
1.2 Embedding step 2: add the Peliqan widget in your own UI
Add inside the<head> tag of your UI:
Show JS code
Show JS code
1.3 Customised list of available connectors
You can optionally provide a list of connectors that should be shown to the user when the modal opens by passing an array of connector names to theavailableConnectors property.
1.2 Embedding step 2: add the Peliqan widget in your own UI
Add inside the<head> tag of your UI:
Show JS code
Show JS code
1.3 Customised list of available connectors
You can optionally provide a list of connectors that should be shown to the user when the modal opens by passing an array of connector names to theavailableConnectors property.
The list should be a sub set of connectors available in Peliqan.The list should be a sub set of connectors available in Peliqan.
Show JS code
Show JS code
Show JS code
Show JS code
1.4 Pre-select a connector4 Pre-select a connector
You can optionally set a connector that should be auto selected when the modal opens. This can be done by providing a connector name to theselectedConnector property.You can optionally set a connector that should be auto selected when the modal opens. This can be done by providing a connector name to the selectedConnector property.
The user will be shown a connection form where they can fill in the connection details.
Show JS code
Show JS code
1.5 Pre-select a connector and skip the Peliqan screen with connection settings
The user will be shown a connection form where they can fill in the connection details.Show JS code
Show JS code
1.5 Pre-select a connector and skip the Peliqan screen with connection settings
If you want to skip the Peliqan connection settings screen (where the user enters e.g. an API key and other required parameters), you need to implement a server-side flow that uses the Peliqan Partner API. In this case there is no front-end embedding.If you want to skip the Peliqan connection settings screen (where the user enters e.g. an API key and other required parameters), you need to implement a server-side flow that uses the Peliqan Partner API. In this case there is no front-end embedding. The connection is added through API calls only and the required parameters need to be requested in the UI from the Partner first. The connection is added through API calls only and the required parameters need to be requested in the UI from the Partner first. See Partner API > “Add a connection” for more infoSee Partner API > “Add a connection” for more info.1.6 Callback function6 Callback function
You can optionally implement a call-back function in JS that Peliqan will invoke once a user successfully added a connection. This allows you to e.g. handle the new connection in your front-end. Example:implement a call-back function in JS that Peliqan will invoke once a user successfully added a connection. This allows you to e.g. handle the new connection in your front-end. Example:Example responseData from callback (click to expand)Example responseData from callback (click to expand)
Example responseData from callback (click to expand)Example responseData from callback (click to expand)
1.7 Set style of the popup modal where the user selects and configures a connector (optional)7 Set style of the popup modal where the user selects and configures a connector (optional)
Customise the style of the integration modal by passing amodalStyle object. All properties are optional. You can set a default style during initialize, and optionally override it per openIntegration callCustomise the style of the integration modal by passing a modalStyle object. All properties are optional. You can set a default style during initialize, and optionally override it per openIntegration call.
Set default style during initialization:
Show JS code
Show JS code
modalStyle object accepts any standard CSS property including:
The default modal is centered using
margin: 'auto'. To adjust the modal’s position, use margin:
2. Back-end integration (fetch data from end-customers)
From your back-end, you can make API calls to Peliqan to e.g. retrieve data from end-customer connections, or to activate data integrations (data syncs). One scenario is to request a list of active customers on Peliqan, for each request the active connections, and for each connection fetch new data:API authorization
There are 2 types of tokens:- partner token
- sub-account tokens
Fetch active customers on Peliqan
Each end-customer has a Sub account under your Partner account in Peliqan. List all your sub-accounts:Fetch a list of databases from a customer
By default your end-customer will have one data warehouse in Peliqan. Data warehouses and databases are called “applications” in the Peliqan API:Read data
List tables:Real-time versus Scheduled data reading
- In a real-time scenario, you invoke logic on your backend, from the JS call-back function described above. This allows you to e.g. fetch data from your customer, immediately after a connection was added.
- In a scheduled scenario, you make API calls to Peliqan on e.g. an hourly or daily basis, to fetch data from your customers.
3. Additional methods for front-end embedding
These additional functions are available after you have initialized the Peliqan SDK usingPeliqan.initialize(). All functions require a sub-account identity token (mentioned above in API Authorisation section). You can then pass the returned JWT token as identityToken to the SDK methods below. You will typically add buttons in your UI, with the below functions as event handlers.
syncServer
Triggers the run of a pipeline for a given connection (server).
Example
getServerHealthStatus
Fetch health information for a specific connection (server).
Example
getServerSyncRunStatus
Check whether a “run pipeline” job is currently running for a given connection (server).
Poll this when showing a “Syncing…” indicator or progress UI.
Example
reAuthoriseServer
Use this if you wish to re-authorise any oAuth connection .
This function opens the required authorization URL in a new browser tab.
If the Peliqan back-end returns an auth_uri, it is automatically opened in a new browser tab.
Example
