The SDK provides the allPermissions method, which returns the complete list of permissions assigned to the currently logged-in Member.
In React, the @stytch/react library provides the withStytchPermissions HOC (higher-order component). Wrapping your component with withStytchPermissions fetches and provides all the permissions associated with the logged-in Member. It returns a response in the form of Record<RoleId, Record<Action, boolean>>. Each boolean value in this structure signifies whether the Member has permission (true) or not (false) to perform the specified action.
If the Member is not logged in, all values will be false.
As a best practice, authorization checks for sensitive actions should also occur on the backend.