Scute UI with your react app, you can do so using the @scute/ui-react package. This package would expose the pre-built Auth and Profile components which you can use to easily integrate Scute to your current app.
Head over to the example project repo to clone and run this example project and check out the type docs for more scuteClient methods.
To get started, install our React SDKs with your favorite package manager:
Terminal
Initialize the Scute client
First initialize the Scute client using thecreateClient method exposed by @scute/react package:
Wrap your React app with Scute AuthContextProvider
To be able to use theuseScuteClient and useAuth hooks, wrap your app inside the Scute AuthContextProvider:
Add the Scute pre-built UI
First, create a component to show to your authenticated users:AuthenticatedView based on the session status:
App.jsx to render the ScuteUI inside the AuthContextProvider:
With session (Profile)
With session (UserButton)
Component API’s
Auth Component
| Property | Type | Default | Description |
|---|---|---|---|
| scuteClient | ScuteClient | undefined | The Scute client instance. This property is required |
| onSignIn? | () => void | undefined | Callback function for sign-in |
| webauthn? | “strict” | “optional” | “disabled" | "optional” | Options for WebAuthn |
| language? | string | ”en” | Language setting |
| appearance? | ? | undefined | Appearance settings |
Profile Component
| Property | Type | Default | Description |
|---|---|---|---|
| scuteClient | ScuteClient | undefined | The Scute client instance |
| language? | string | ”en” | Language setting |
UserButton Component
| Property | Type | Default | Description |
|---|---|---|---|
| scuteClient | ScuteClient | undefined | The Scute client instance |
| language? | string | ”en” | Language setting |
| username? | string | undefined | Username to display |
| profileUrl? | string | undefined | Profile URL to navigate to |
| profilePictureUrl? | string | undefined | Profile picture URL |