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).

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 ParameterSDK syntaxMandatoryDescription
universeuniverseyesYour Splio tenant identifier.
n/aconfiguration_idyesConfiguration Id of your SDK. You need 1 configuration per language - configuration(1:1)lang.
contact_idexternal_idyes (authenticated user)Unique key of the contact set in your Splio universe.
card_codecard_codenoNeed 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.
emailemailnoEmail of the contact.
list_idslist_idsnoSubscribe 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:

If you are using a custom font (other than web-safe fonts), don't forget to add the <style> snippet from the recipe above.