KnockDocs

Setting preferences

You can read more about modeling preferences and preferences in general in the Modeling Preferences guide.

Backend integration

In the following examples you'll see how to integrate preferences into your backend codebase:

Getting the users preferences

You can retrieve the users preferences using the preferences.get method. Please note, that even if the preferences are not set for the user you will receive a PreferenceSet back (which will be empty).

Setting the users preferences

You can update a users entire preference set using the preferences.set method. This will overwrite any existing preferences set for the user:

Client integration

The preference API can also be invoked from the front-end, providing you have authenticated a user first and have a valid API token. Please note: only the current users preferences can be set from the client.

Retrieving the preferences for the current user

Setting the preferences for the current user

Preferences can also be updated from the client: