Embedding Livble - Alternative Approach
Learn how to embed the Livble Experience using the SDK
This is Not The Recommended ApproachThe following guide displays an alternative approach on how to integrate with Livble.
To see the guide for the recommended way, click here.
💻 Code Snippet
The following snippet demonstrates how to use the Livble SDK to embed and display the Livble experience in your tenant portal without using the Livble widget.
Next, we'll go over each parameter used to configure the SDK experience.
import { openExperience, Environment } from "@lvble/react";
const token = "..."; // get token from your backend
openExperience({token: token, environment: Environment.Production, onEvent: onLvbleEvent});import { Environment, Lvble } from "@lvble/core"
const token = "..."; // get token from your backend
const l = Lvble({
environment: Environment.Production,
onEvent: (eventType, data) => { },
});
l.open(token);
👁️ Parameters Overview
A high-level overview of each parameter. More in-depth guides are available for relevant parameters.
| 🏷️ Name | 📝 Description | ✍️ Notes |
|---|---|---|
onEvent |
A callback function that receives events emitted by the Livble SDK. | 📖 Jump here for more info |
environment |
Defines the environment mode in which the SDK operates. | Possible values are:Sandbox | Production |
token |
A token that is used to open the Livble Experience. |
🚀 Launching the Livble Experience
💡 Overview:
In order to launch the Livble Experience, use the Livble SDK method openExperience() or open()
(The method's signature may vary slightly between React and Vanilla JS implementations)
🔑 What is The token And How to Get It?
token And How to Get It?The token argument in the openExperience() is an authentication token that should be retrieved for the tenant using Livble's API.
It can be retrieved as follows:
- Make a call to Livble's API
POST /tenant/portal_info/:external_idendpoint (see API reference) - Extract the Livble token from the response.
- Use the Livble SDK's
openExperience()method to launch the Livble Experience.
(The method signature may vary slightly between React and Vanilla JS implementations.)
API Key SecurityThe
POST /tenant/portal_info/:external_idcall must be made from your backend.
This is because it requires the Livble API key, which should not be exposed in the frontend.
Updated 8 months ago