Implementation
Dernière mise à jour
Cet article vous a-t-il été utile ?
Dernière mise à jour
Cet article vous a-t-il été utile ?
Once you've created your widget on MeltingSpot, you can embed it in the page of your choice. Depending on the type of widget you've chosen (embed
, drawer
or modal
), your widget won't integrate in the same way. It's up to you to select the rendering mode that suits you best!
You can get a widget's code by clicking on the Get code
button, from 2 different locations:
The widget preview window.
The widget card in the widget list.
A menu opens. This menu offers 2 different ways of getting the code:
Send instructions
: opens your mailbox with a pre-written email containing your widget's code.
Copy code
: opens a window containing your widget's code. You can copy any part of the code by clicking on Copy.
This code is in two parts and will enable you to integrate your widget into your application or website.
Copy the script and paste it into the <head>
section of your page.
Copy the script shown and paste it into a frame in the <body>
of your page.
You may need to edit some elements of this script to configure your widget's design, integration and redirection settings:
Your frame size. By default, your frame fills its parent element due to the setting style="width:100%;height:100%"
. You can change this setting, but we recommend you edit the size of its parent element.
Appearance mode (light or dark theme). By default, themeMode
is set to the value Auto
. You can change it to one of the following options:
auto
The user's system mode, unless they specify it otherwise in their profile settings.
system
The user's system mode.
light
All users will be in light mode.
dark
All users will be in dark mode.
For instance, if you embed your Spot into a white interface, we recommend you set themeMode
to light
.
The user's redirection domain: this parameter only concerns Spots for which an embed has been set up on several domains. If you've sent us one or more domain keys via JWT token or API, you will be able to use this feature. (👉 Know more about multi-domain embed here). Redirect the user who clicks on a widget to the domain of your choice by indicating the domain key in the script, as follows: