Provides authentication context to all child components.
Wrap your application (or the portion that needs auth) with IdentityProvider to enable the useIdentity, useUser, useAuthState, and useAuthActions hooks.
IdentityProvider
useIdentity
useUser
useAuthState
useAuthActions
Key Features:
localStorage
import { IdentityProvider } from '@hiyve/react-identity';function App() { return ( <IdentityProvider apiKey="pk_live_xxx"> <MyApp /> </IdentityProvider> );} Copy
import { IdentityProvider } from '@hiyve/react-identity';function App() { return ( <IdentityProvider apiKey="pk_live_xxx"> <MyApp /> </IdentityProvider> );}
<IdentityProvider apiKey="pk_test_xxx" environment="development" tokenStorage="memory"> <MyApp /></IdentityProvider> Copy
<IdentityProvider apiKey="pk_test_xxx" environment="development" tokenStorage="memory"> <MyApp /></IdentityProvider>
Provides authentication context to all child components.
Wrap your application (or the portion that needs auth) with
IdentityProviderto enable theuseIdentity,useUser,useAuthState, anduseAuthActionshooks.