Skip to main content

Documentation Index

Fetch the complete documentation index at: https://engage-docs.frigade.com/llms.txt

Use this file to discover all available pages before exploring further.

The useFrigade() hook exposes the underlying Frigade JS SDK instance that powers the React SDK. View the Frigade class docs to see the available fields and methods.

About this hook

The useFrigade hook can be used to access the underlying Frigade JS SDK instance and interact with it directly. It should rarely be used as the provided useFlow, useUser, and useGroup hooks should be sufficient for most use cases.

Example usage:

import { useFrigade } from "@frigade/react";

function MyComponent() {
  const { frigade } = useFrigade();

  useEffect(() => {
  	const myHandler = (flow) => {
      console.log(`Detected change in ${flow.id}`);
    }
    frigade.onStateChange(myHandler);
    return () => {
      frigade.removeStateChangeHandler(myHandler);
    }
  }, []);
}
Make sure to call any Frigade hook within the context of <Frigade.Provider />