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 environmentuserUserIdentificationOptions
User identification data including id and optional propertiesuserTokenstring
The user token for the authenticated useroptionsAuthenticatedKnockClientOptions
Optional configuration for the authenticated Knock clientReturns#
knockKnock
The authenticated Knock client instanceExample#
Basic usage#
The following example demonstrates how to use the useAuthenticatedKnockClient
hook to create an authenticated Knock client.