Using Vanilla JavaScript
Build your JWT server-side
This is the token to authenticate your loyalty program & your user (i.e., used by the SDK to authenticate requests for both authenticated and non-authenticated users).
🦉
How to embed the Loyalty SDK to your Website?
Open Recipe
You can build your JWT by passing the following data. When a user is authenticated in your website, you need to pass its data that will be upserted into Splio (Contacts and Members):
Splio Parameter | SDK syntax | Mandatory | Description |
---|---|---|---|
universe | universe | yes | Your Splio tenant identifier. |
n/a | configuration_id | yes | Configuration Id of your SDK. You need 1 configuration per language - configuration(1:1)lang. |
contact_id | external_id | yes (authenticated user) | Unique key of the contact set in your Splio universe. |
card_code | card_code | no | Need to be provided, only if Splio Customer Platform is not owning its attribution. Used to uniquely identify a membership to a program. If you are providing it, make sure that it is unique and immutable. |
no | Email of the contact. | ||
list_ids | list_ids | no | Subscribe the contact to the list(s) which ids are provided (comma separated). Check this article for more information about List Management. |
Initialize the SDK client side
Load the SDK client-side and decide on key options like the language, display mode, font.
Reminder: each SDK configuration is associated to one language.
Please try the following recipe to learn how to do it:
Loyalty Web Kit - Initialization of the SDK
Open Recipe
If you are using a custom font (other than web-safe fonts), don't forget to add the <style>
snippet from the recipe above.
Updated over 1 year ago