Embed Peaka’s UI in Your Web Application
You can easily integrate Peaka’s UI into your own web application. This allows your users to enjoy the full range of Peaka’s advanced features without ever leaving your platform. By embedding Peaka, you provide a seamless and cohesive experience, empowering your users with the tools they need to maximize productivity and efficiency.Key Benefits:
- Access all premium features via API or UI.
- Embed Peaka’s UI directly into your web application.
- Deliver a unified experience for your users.
- Enhance productivity with Peaka’s advanced tools.
TLDR;
If you want to see it in action you can check our example applications that created in NextJs with Python/NodeJS backend. Go to Python App Go to Node App Go to Running ExamplePrerequisites
- Partner API Key: To create a Partner API Key, please refer to our guide on managing partner API keys.
Initiate the Session
- To begin, you need to initiate a session with Peaka using your Partner API Key as the token.
- The endpoint will provide a URL to initiate your session.
Enabling Embedded UI for Peaka Integration Using an iframe
For security reasons, you cannot use the session URL directly in an iframe. To embed Peaka within an iframe, you need to enable the embedded UI for your partner API key. In order to do that you should;-
Go to
Developer Settingsin your peaka account.
-
Find your api key in the table then click
...button.
-
Select
Enable Embedded UIoption
-
Enable Embedded UI for this API Key
-
Enter your domain that you want to embed the Peaka app.
-
Enter a Company Name for white labeling in Embedded UI.
-
If you want to customize the UI, click “Customize UI Theme” button then give a theme name and upload your custom css file. You can also download the valid example of the customization file (Check out the related documentation to learn more about customization).
You can add custom css files more than one and change themes in runtime.
After you set the css file, you should start the session with following parameters to enable custom theme.
Hiding Parts of the Embedded UI
In Embedded Mode, you can customize the Peaka UI by hiding specific components or features. To do this, use thefeatureFlags key when initiating the UI session. This allows you to tailor the interface to your application’s needs, ensuring a seamless and focused user experience.
Example:
When initializing the UI session, specify the features you want to hide or disable using thefeatureFlags configuration. This ensures that only the relevant parts of the UI are displayed to your users. For example you can hide queries sections in Peaka’s UI with following configuration.
Peaka as a Connector-Only Solution
When you need to use Peaka exclusively as a connector solution, you can configure the UI session to display only the connector functionality. This streamlined approach is perfect for applications that focus on data source connections without requiring the full Peaka studio experience. First, initialize the session with following payload options:Configuration Options:
SessionMode: Specifies the mode of the session. Available options are: ConnectorType: Specifies the type of connector interface to display. Available options can be found in the API Reference. CatalogCreateEnabled: Boolean flag that controls whether catalogs are automatically created when establishing connections. The default value istrue. Set this to false only when using CONNECTOR_MODAL_ONLY mode to prevent automatic catalog creation.
CONNECTOR_MODAL_ONLYFULL_STUDIO
CONNECTOR_MODAL_ONLY mode.
Example:
The API response includessessionUrl and partnerOrigin properties, allowing you to open the Peaka interface in a popup window for seamless integration.
In this example, we’re using the CONNECTOR_MODAL_ONLY mode to display only the connector modal interface. We get the session URL and partner origin from the API response and open the Peaka interface in a popup window.
Troubleshooting
If you are having trouble with having status from the connector popup, follow these steps to troubleshoot the issue:- Check if you have enabled Embedded UI Settings for your API Key.
- Add your domain that you want to embed the Peaka app to the Embedded UI Settings in the Developer Settings.