Skip to content

Commit

Permalink
opa-react: fix low-level '@styra/opa' opaClient example (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
srenatus authored Jul 16, 2024
1 parent 884d4b3 commit 4410182
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/opa-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ They can either be used by providing static children (`<button>Press Here</butto
```

The `useAuthz` hook can be used if you need more low-level control about the authorization call.
Furthermore, you can retrieve the prepared `sdk` instance of `AuthzProvider` for even more control, if need be:
Furthermore, you can retrieve the prepared `opaClient` instance of `AuthzProvider` for even more control, if need be:

```tsx
import { AuthzContext } from "@styra/opa-react";

export default function Component() {
const { sdk } = useContext(AuthzContext);
// now you can use `sdk.evaluate()` etc directly
const { opaClient } = useContext(AuthzContext);
// now you can use `opaClient.evaluate()` etc directly
}
```

Expand Down

0 comments on commit 4410182

Please sign in to comment.