@openrails/billing-ui 0.275.0 → 0.276.0

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
@@ -9,7 +9,7 @@ administration inside the host's application.
9
9
  | `@openrails/billing-ui/react` | `BillingProvider` and headless hooks, without styles |
10
10
  | `@openrails/billing-ui` | `BillingProvider`, styled purchase and account components, i18n |
11
11
  | `@openrails/billing-ui/locales/*` | `en de es ja ko zh` message bundles |
12
- | `@openrails/billing-ui/admin` | `BillingAdmin`, `BillingCustomerSummary`, access and confirmation helpers |
12
+ | `@openrails/billing-ui/admin` | `AdminConsole`, `BillingAdmin`, `BillingCustomerSummary`, access and warning helpers |
13
13
  | `@openrails/billing-ui/admin.css` | Scoped staff administration styles |
14
14
 
15
15
  The purchase owns the browser payment flow, behind `<BuyButton>`, `<ProductList>`
@@ -254,6 +254,15 @@ then does not request them to load; a retry still reads the server's copy:
254
254
 
255
255
  ## Staff administration
256
256
 
257
+ `AdminConsole` is the whole staff console, AuthKit's account administration and
258
+ billing together, configured rather than composed (needs `@openrails/auth-ui`):
259
+
260
+ ```tsx
261
+ <AdminConsole authBaseUrl="/api/v1" billingBaseUrl="/billing/v1" merchant={merchant} basePath="/admin" />
262
+ ```
263
+
264
+ To compose your own pages instead:
265
+
257
266
  Install the admin entry's optional peer with `pnpm add @tanstack/react-query`.
258
267
  The host owns sign-in and passes its authenticated transport and router:
259
268
 
@@ -0,0 +1,33 @@
1
+ import { StepUpProviderProps } from '@openrails/auth-ui';
2
+ import { AdminNavigation, AuthAdminProps } from '@openrails/auth-ui/admin';
3
+ import { BillingAdminMerchant, BillingAdminProps } from './types';
4
+ export interface AdminConsoleProps {
5
+ /** AuthKit's JSON API mount, e.g. `/api/v1`. */
6
+ authBaseUrl: string;
7
+ /** The engine's API prefix, including /v1. */
8
+ billingBaseUrl: string;
9
+ merchant?: string | BillingAdminMerchant;
10
+ /** Where the console is mounted. Default `/admin`. */
11
+ basePath?: string;
12
+ /** The host router; the history API without one. */
13
+ navigation?: AdminNavigation;
14
+ /** The host's sign-in page, opened with `?return_to=`; AuthKit's sign-in panel without one. */
15
+ signInPath?: string;
16
+ appearance?: BillingAdminProps["appearance"];
17
+ /** AuthKit's admin language; billing administration is English. */
18
+ language?: string;
19
+ /** The user directory's options: tenant, entitlements, languages, and the host's own panels and warnings after billing's. */
20
+ users?: Exclude<AuthAdminProps["users"], false | undefined>;
21
+ /** Resolves the linked Solana wallet's signer for a wallet step-up. */
22
+ acquireSolanaSigner?: StepUpProviderProps["acquireSolanaSigner"];
23
+ className?: string;
24
+ }
25
+ /**
26
+ * The staff console: AuthKit's account administration at `basePath` (users,
27
+ * members, roles, credentials) and billing administration at
28
+ * `basePath/billing`, each shown only to whoever holds its permissions. Users
29
+ * carry their billing summary and a subscription warning before a ban or
30
+ * delete; AuthKit's writes step up through the console's dialog. Render it
31
+ * inside the host's `AuthProvider`. Every request is authorized by its API.
32
+ */
33
+ export declare function AdminConsole(props: AdminConsoleProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  export { BillingAdmin } from './billing-admin';
2
+ export { AdminConsole, type AdminConsoleProps } from './console';
2
3
  export type { BillingAdminProps, BillingAdminAuth, BillingAdminMerchant, BillingAdminNavigation, BillingAdminResource, BillingAdminSettingsTab, } from './types';
3
4
  export { BillingCustomerSummary, billingConfirmWarnings, loadBillingConfirmWarnings, billingPermissionHelp, useBillingAdminAccess, } from './summary';
4
5
  export type { BillingCustomerSummaryProps, BillingConfirmWarningsOptions, } from './summary';