@outseta/react 0.2.5 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,29 +1,37 @@
1
1
  # @outseta/react
2
2
 
3
- React hooks and components for the [Outseta](https://www.outseta.com) API. Built on [TanStack Query](https://tanstack.com/query) with auto-generated hooks from the Outseta OpenAPI spec.
3
+ React components plus generated TanStack Query hooks for Outseta.
4
4
 
5
- ## Install
5
+ ## Notes
6
6
 
7
- ```bash
8
- npm install @outseta/react
9
- ```
7
+ - The embed components depend on `window.Outseta`; load Outseta's script in your app shell before using `OutsetaProvider`.
8
+ - In browser apps, create API clients with a user bearer `accessToken`, not API key credentials.
9
+ - Generated hooks require a TanStack `QueryClientProvider` and an Outseta client passed through each hook's `request` option.
10
+ - `ProtectedRoute` renders generic login/signup and manage-subscription CTAs by default. Replace them with `unauthenticated` and `accessDenied` props when your app needs custom UX.
10
11
 
11
- ### Peer dependencies
12
+ ## Outseta script
12
13
 
13
- - `react` ^18.0.0 || ^19.0.0
14
+ ```html
15
+ <script>
16
+ var o_options = {
17
+ domain: "your-company.outseta.com",
18
+ load: "auth,nocode",
19
+ };
20
+ </script>
21
+ <script src="https://cdn.outseta.com/outseta.min.js" data-options="o_options"></script>
22
+ ```
14
23
 
15
- ## Usage
24
+ ## Generated hook request client
16
25
 
17
- ```ts
18
- import { createClient } from "@outseta/react";
26
+ ```tsx
27
+ import { createClient, useAccountGetAllAccounts } from "@outseta/react";
19
28
 
20
29
  const client = createClient({
21
30
  subdomain: "your-company",
22
- apiKey: "your-api-key",
23
- apiSecret: "your-api-secret",
31
+ accessToken,
24
32
  });
25
- ```
26
33
 
27
- ## License
28
-
29
- [MIT](../../LICENSE)
34
+ const accounts = useAccountGetAllAccounts(undefined, {
35
+ request: client,
36
+ });
37
+ ```