Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

useClerk()

The useClerk() hook provides access to the Clerk object, giving you the ability to build alternatives to any Clerk Component.

This is intended to be used for advanced use cases, like building a completely custom OAuth flow or as an escape hatch for getting access to the Clerk object.

useClerk() returns

The useClerk() hook returns the Clerk object, which includes all the methods and properties listed in the Clerk reference.

How to use the useClerk() hook

home.tsx
import { useClerk } from "@clerk/clerk-react"; export default function Home() { const clerk = useClerk(); return <button onClick={() => clerk.openSignIn({})}>Sign in</button>; };

Last updated on February 22, 2024

What did you think of this content?

Clerk © 2024