editPersonPreferences
Manage communication preferences, language settings, and notification options
Overview
The editPersonPreferences widget provides an interface for managing person communication and language preferences. This widget includes:
- Communication preference toggles
- Language selection
- Notification settings
- Customizable section visibility
Use this widget to build preference centers, account settings pages, or communication opt-in/opt-out flows.
Authentication
This widget uses standard JWT API tokens. No widget token is required.
Wicket.widgets.editPersonPreferences({
accessToken: userJwtToken, // Standard JWT token
personId: personUuid,
rootEl: container
});See the Authentication Guide for details on generating JWT tokens.
Parameters
Prop
Type
Events
The widget emits the following events:
WIDGET_LOADED
Fired when the widget has initialized and rendered.
SAVE_SUCCESS
Fired when preferences are successfully saved.
ERROR
Fired when an error occurs during widget operation.
Return Value
Returns a Promise<WidgetLoadResult> that resolves with:
Prop
Type
Example
Wicket.ready(function () {
var widgetRoot = document.getElementById('root');
Wicket.widgets.editPersonPreferences({
loadIcons: true,
accessToken: clientToken,
apiRoot: apiRoot,
personId: "abcd-1234-efgh-5678",
lang: "en",
hideSectionTitle: true
}).then(function (widget) {
widget.listen(widget.eventTypes.WIDGET_LOADED, function (payload) {
console.log('widget loaded:', payload);
});
widget.listen(widget.eventTypes.SAVE_SUCCESS, function (payload) {
console.log("preferences saved:", payload);
});
});
});Try it Live
Configure and test the widget with your Wicket instance.
⚠️ Credentials are stored in your browser's localStorage