@outseta/react
v0.3.6
Published
React hooks and components for the Outseta API
Keywords
Readme
@outseta/react
React components plus generated TanStack Query hooks for Outseta.
Notes
- The embed components depend on
window.Outseta; load Outseta's script in your app shell before usingOutsetaProvider. - In browser apps, create API clients with a user bearer
accessToken, not API key credentials. - Generated hooks require a TanStack
QueryClientProviderand an Outseta client passed through each hook'srequestoption. ProtectedRouterenders generic login/signup and manage-subscription CTAs by default. Replace them withunauthenticatedandaccessDeniedprops when your app needs custom UX.
Outseta script
<script>
var o_options = {
domain: "your-company.outseta.com",
load: "auth,nocode",
};
</script>
<script src="https://cdn.outseta.com/outseta.min.js" data-options="o_options"></script>Generated hook request client
import { createClient, useAccountGetAllAccounts } from "@outseta/react";
const client = createClient({
subdomain: "your-company",
accessToken,
});
const accounts = useAccountGetAllAccounts(undefined, {
request: client,
});