@permitio/permit-react
v1.0.6
Published
permit-react
Downloads
3
Readme
permit-react-sdk
usage:
<PermitProvider loginMethod={LoginMethod.cookie} loginUrl={`${customerBackendUrl}/login_cookie`} >
<BrowserRouter>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/users" element={<UserManagementEmbed embedUrl={"https://embed.permit.io/<ELEMENT_ID>?envId=<ENV_ID>"} />} />
</Routes>
</BrowserRouter>
</PermitProvider>
Provider props:
export interface PermitProviderProps {
loginUrl: string
tenant?: string
loginMethod: LoginMethod
token?: string
children: React.ReactNode
headers?: Record<string, string>
onError?: (error: any) => void
onLogin?: (res: any) => void
errorComponent?: React.ReactNode
}
Embed props:
interface Props {
embedUrl: string
width?: string
height?: string
style?: React.CSSProperties
}