Custom tabs and js-bridge - Prenly
A common issue when adding a custom tab with content not originating from Prenly is that this content is hosted on a separate webpage and cannot communicate with Prenly content.
To address this challenge, we have developed an API called JS Bridge, which enables a seamless app experience for your users.
When you implement JS Bridge on your webpage, the pages in your custom tabs will be able to communicate directly with the Prenly part of the app via JavaScript calls.
For login functionality, this means that users only need to log in once—whether they access the app through the Prenly section or through your custom web content tabs.
User consent settings will also be synchronized between Prenly and your web application.
Using JS Bridge, users can also play audio found on your custom pages directly in our built-in audio player.
How is it implemented?
To allow your custom web content to communicate with the Prenly app, follow these steps:
1. Install the JS Bridge Library
JS Bridge is a custom-built JavaScript library that needs to be installed on the webpage displayed in the Prenly app.
Visit GitHub and npm to find instructions on the installation.
2. Notify us to activate the feature
Once the JS Bridge is added to your page, let us know—we’ll activate the integration on the Prenly side to complete the setup.
3. Use JS Bridge
Once installed, you can use the JavaScript functions provided by the library to interact with the Prenly app. For example:
• Trigger login sync
• Share consent settings
• Use the in-app audio player for media on your page
For a complete list of the actions currently supported by JS Bridge, please see our technical specification.