Skip to content

Commit

Permalink
opa-react: update changeset and README
Browse files Browse the repository at this point in the history
  • Loading branch information
srenatus committed Jul 10, 2024
1 parent 9365825 commit 872b27d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .changeset/strong-melons-sip.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"@styra/opa-react": minor
---

change exported interfaces names
change exported interfaces names, and AuthzProvider property

The export iterface `SDK` is now called `OPAClient` for consistency with `@styra/opa`.

It is used in `AuthzProviderContext` and `AuthzProviderProps`.
It is used in `AuthzProviderContext` and `AuthzProviderProps`, and has been renamed from `sdk` to `opaClient`.
4 changes: 2 additions & 2 deletions packages/opa-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ The package provides an `useAuthz` hook and a high-level `<Authz>` component.
They are enabled by wrapping your App into `<AuthzProvider>`:

```tsx
<AuthzProvider sdk={sdk} defaultPath="policy" defaultInput={{ user, tenant }}>
<AuthzProvider opaClient={opaClient} defaultPath="policy" defaultInput={{ user, tenant }}>
<Nav />
<Outlet />
</AuthzProvider>
```

This example provides a previously-configured `sdk` instance (`OPAClient` from `@styra/opa`), a request path, and default input (which is merged with per-call inputs).
This example provides a previously-configured `opaClient` instance (`OPAClient` from `@styra/opa`), a request path, and default input (which is merged with per-call inputs).

They can either be used by providing static children (`<button>Press Here</button>`) and optionally `fallback` and `loading` JSX elements:
```tsx
Expand Down

0 comments on commit 872b27d

Please sign in to comment.