The Experience JS SDK provides functions to customize and extend experiences published with Wyng. The SDK comprises these major functional areas:
- Action Dispatcher
- Event Listener
- Setting Values
- Overriding Components
- Custom Metrics
This SDK allows developers to programmatically interact with experiences
through a global
sets a value, dispatches an event, or registers a callback function for a given event.
The SDK is located at the
window level and scoped by experience ID.
The methods can be accessed through
window.wyng['YOUR EXPERIENCE ID'].
the experience editor, you may use the special
_WYNG_ID_ tag, which will automatically
be replaced with the active experience ID.
A good starting point is something like this:
const sdk = window.wyng['_WYNG_ID_'];
Local User ID
Across Wyng platforms an anonymous Local User ID will be assigned to a visitor. This ID is used to identify return visitors, and is scoped by the fully qualified domain of the containing web page, and stored in browser localStorage on the visitor's device.
Get the value of the Local User ID. If no value has been set yet, a value will be randomly generated.