β«Widget API
Introducing the Sesame Labs Widget and Widget API! In this section weβll cover off on how to deploy Widget and configure it via Widget API.
Letβs get right to it!
Sign-up for Community Hub today
Widget deployment
Our no-code & low-code approaches to development is embodied in Widget. Deployment onto any web property is as simple as adding a script to the <head> tag of your index.html
file:
Widget configuration
Once deployed, you can configure Widget via the API. Youβll find the configuration parameters via the window.Sesame
object on the client side
Required widget keys
PUBLIC_KEY - stored on client server (you)
PRIVATE_KEY - stored on vendor server (Sesame Labs)
How to get the keys?
Get in touch with us to obtain your keys
The client must path secure data in encrypted form. Every payload with sensitive data should be encrypted with PUBLIC_KEY
Methods available via window.Sesame
Widget API uses asymmetric cryptography to pass secure data from client to vendor.
One aspect to note when calling a window.Sesame
method. It may take some time to load, so add null safety to avoid errors.
Hereβs an example of calling a window.Sesame
method:
1) Open/close
Property name - open/close
Action - open/close widget
Returns - void
Usage
2**) Hide/show**
Property name - hide
Action - hide the widget from page
<aside> π‘ Note: If the widget is hidden open/close
will not open the widget. need to call show()
firstly
</aside>
Returns - void
Usage
3) Login
(π 0 - secure payload. This should be encrypted.)
Property name - login
Action - authenticated user into widget based on data from client web app
Returns - void
Usage
How to get authData
Simply call receiverPublicKey
(PUBLIC_KEY is only available by contacting Sesame Labs)
4) trustLogin
Property name - trustLogin
Action - login user with current selected Ethereum wallet address
Returns - boolean
Usage
5) isLoggedIn
Property name - isLoggedIn
Action - check cookies validity. if not valid it will logout user from the widget automatically
Returns - boolean
Last updated