Docs
/
/
In-App UI
React
Hooks
useGuides

useGuides

The useGuides hook returns an array of guides matching the provided filter criteria. It supports typing the guide step content to ensure type safety.

Starting in version 0.10.0 of @knocklabs/react, useGuides respects throttling rules by default, similar to useGuide.

Parameters

#

The hook accepts two parameters: a filter object and an optional options object.

Filter object

#
typestringRequired

Match any guide by its type, which corresponds to the key of a message type.

Options object

#
includeThrottledboolean

When set to true, returns all eligible guides regardless of throttling rules. Defaults to false.

Returns

#

A UseGuidesReturn object with the following properties:

guidesKnockGuide[]

Zero or more matching guides.

Example

#

Getting guides for a specific message type

#

Typing the guides

#

Including throttled guides

#

By default, useGuides respects throttling rules. To return all eligible guides regardless of throttling, pass includeThrottled: true:

New chat