Skip to content

Latest commit

 

History

History
129 lines (60 loc) · 1.69 KB

react.md

File metadata and controls

129 lines (60 loc) · 1.69 KB

Home > @cerbos/react

react package

A collection of React hooks for interacting with Cerbos policy decision points.

Functions

Function

Description

CerbosProvider({ children, client, principal, auxData, })

A component to provide a Cerbos client to your application's components.

useCerbos()

A hook to access the Cerbos client passed down by the CerbosProvider().

useCheckResource(request, options)

Check the principal's permissions on a resource.

useCheckResources(request, options)

Check the principal's permissions on a set of resources.

useIsAllowed(request, options)

Check if the principal is allowed to perform an action on a resource.

Interfaces

Interface

Description

CerbosProviderProps

Props for the CerbosProvider() component.

Type Aliases

Type Alias

Description

AsyncResult

The result of calling an async method on a client.