In-App UI
React
Hooks
useAuthenticatedKnockClient

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

#

Accepts an object (UseAuthenticatedKnockClientParams) with the following properties:

apiKeystring

The public API key for the environment.

userUserIdentificationOptions

User identification data including id and optional properties.

userTokenstring

The user token for the authenticated user.

optionsAuthenticatedKnockClientOptions

Optional configuration for the authenticated Knock client.

Returns

#
knockKnock

The authenticated Knock client instance.

Example

#

Basic usage

#

The following example demonstrates how to use the useAuthenticatedKnockClient hook to create an authenticated Knock client.