The main entry point for the TECSAFE Widget SDK. This class should only be instantiated after the user has consented to the terms, conditions, and privacy policy!
A function that returns the customer token as a string inside a promise. It is expected that you implement a route in your backend, using your own auth method, and request a token from our backend, forwarding the oldToken if provided to ensure proper session upgrading.
OptionaloldToken: stringA function that adds a product to the cart, given the product details, returning a success status.
The configuration for the SDK.
Internal method to trigger listeners from a widget
Creates a custom page widget
The element to attach the widget to
The custom page widget
Creates a product detail widget
The element to attach the widget to
The product detail widget
Emits a message to all widgets
The message definition
The payload to send
this
Gets the config
The config
Gets the widgets
The widgets
Stops listening to a message from any widget
The message definition
The handler to remove
this
Listens to a message from any widget
The message definition
The handler to call when the message is received
this
Listens to a message from any widget once
The message definition
The handler to call when the message is received
this
Sends a message to all widgets
The message to send
ProtectedtriggerTriggers all listeners for a given message type
The message type
The message envelope containing the payload
The SDK instance
The widget instance
The main entry point for the TECSAFE Widget SDK