mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-30 21:01:54 +08:00
26 lines
839 B
Plaintext
26 lines
839 B
Plaintext
---
|
|
title: "useHexclaveApp"
|
|
description: "React hook to retrieve the HexclaveClientApp instance from the HexclaveProvider."
|
|
sidebarTitle: "useHexclaveApp"
|
|
icon: "react"
|
|
mode: "wide"
|
|
---
|
|
|
|
The `useHexclaveApp` hook returns a `HexclaveClientApp` object from the one that you provided in the setup flow. If you want to learn more about the `HexclaveClientApp` object, check out the [StackApp](/sdk/objects/hexclave-app) documentation.
|
|
|
|
## Usage
|
|
|
|
```jsx
|
|
import { useHexclaveApp } from "@hexclave/next"; // replace `next` with the correct framework SDK package
|
|
|
|
function MyComponent() {
|
|
const hexclaveApp = useHexclaveApp();
|
|
return <button onClick={async () => await hexclaveApp.redirectToSignIn()}>Sign in</button>;
|
|
}
|
|
```
|
|
|
|
## Related
|
|
|
|
- [Setup guide](/guides/getting-started/setup)
|
|
- [StackApp object reference](/sdk/objects/hexclave-app)
|