UNPKG

@kinde-oss/kinde-auth-react

Version:

Kinde React SDK for authentication

13 lines (9 loc) 343 B
import { useContext } from "react"; import { KindeContext, KindeContextProps } from "../state/KindeContext"; export const useKindeAuth = (): KindeContextProps => { const context = useContext(KindeContext); if (context === null) { throw new Error("Oooops! useKindeAuth must be used within a KindeProvider"); } return context; };