useAuthenticatedKnockClient
The useAuthenticatedKnockClient hook is used to create and manage an authenticated Knock client instance for making API calls on behalf of a specific user.
Parameters
#This hook accepts positional parameters:
The public API key for the environment.
User identification data. Can be a string user ID or an object with id and optional properties.
Optional user token for the authenticated user.
Optional configuration for the authenticated Knock client.
Returns
#Returns a Knock client instance directly (not wrapped in an object).
Example
#Basic usage
#The following example demonstrates how to use the useAuthenticatedKnockClient hook to create an authenticated Knock client.
With options
#You can pass additional options for the Knock client:
Using string user ID (deprecated)
#While you can pass a string user ID directly, it's recommended to use an object: