@scute/react-hooks package. This package exposes the useAuth and useScuteClient hooks, which allow you to build your own custom UI while still leveraging Scute’s authentication logic.
Head over to the example projects repo to see the hooks in action and check out the type docs for more scuteClient methods.
To get started, install our React SDK with your favorite package manager:
Terminal
Initialize the Scute client
First initialize the Scute client using thecreateClient method exposed by @scute/react-hooks package:
Wrap your React app with Scute AuthContextProvider
To be able to use theuseScuteClient and useAuth hooks, wrap your app inside the Scute AuthContextProvider:
Using the hooks
Now you can use theuseAuth and useScuteClient hooks in your components.
useAuth
The useAuth hook provides access to the authentication state and the current user.
useScuteClient
The useScuteClient hook provides access to the Scute client instance.