@wacht/jsx 1.0.0-beta.2 → 1.0.0-beta.24

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,11 +1,21 @@
1
1
  # @wacht/jsx
2
2
 
3
- Core React UI/auth package for Wacht.
3
+ Shared React components and hooks for building Wacht-powered product surfaces.
4
4
 
5
- Use this package directly for framework-agnostic React apps, or through:
6
- - `@wacht/nextjs`
7
- - `@wacht/react-router`
8
- - `@wacht/tanstack-router`
5
+ Use `@wacht/jsx` when you want the core Wacht React layer without committing to a framework adapter. If you are using Next.js, React Router, or TanStack Router, you will usually install the adapter package instead and import the same primitives from there.
6
+
7
+ - Docs: https://docs.wacht.dev
8
+ - npm: https://www.npmjs.com/package/@wacht/jsx
9
+
10
+ ## What it includes
11
+
12
+ `@wacht/jsx` contains the shared client-side building blocks behind the framework adapters:
13
+
14
+ - auth UI such as `SignInForm`, `SignUpForm`, `WaitlistForm`, `SSOCallback`, and `MagicLinkVerification`
15
+ - control components such as `SignedIn`, `SignedOut`, `SignedInAccounts`, and `NavigateToSignIn`
16
+ - account and tenancy components such as `UserButton`, `UserControls`, `ManageAccount`, `ManageOrganization`, `ManageWorkspace`, `CreateOrganizationForm`, and `CreateWorkspaceForm`
17
+ - notifications components such as `NotificationBell`, `NotificationPopover`, and `NotificationPanel`
18
+ - shared hooks for auth, session state, multi-tenancy, notifications, agents, webhooks, and API identity
9
19
 
10
20
  ## Install
11
21
 
@@ -13,17 +23,23 @@ Use this package directly for framework-agnostic React apps, or through:
13
23
  pnpm add @wacht/jsx @wacht/types
14
24
  ```
15
25
 
16
- ## Basic Setup
26
+ ## Basic usage
17
27
 
18
28
  ```tsx
19
- import { DeploymentProvider, SignInForm, SignedIn, SignedOut } from "@wacht/jsx";
29
+ import {
30
+ DeploymentProvider,
31
+ SignedIn,
32
+ SignedOut,
33
+ SignInForm,
34
+ } from "@wacht/jsx";
20
35
 
21
- export function App() {
36
+ export default function App() {
22
37
  return (
23
- <DeploymentProvider publicKey={process.env.NEXT_PUBLIC_WACHT_PUBLISHABLE_KEY!}>
38
+ <DeploymentProvider publicKey={import.meta.env.VITE_WACHT_PUBLISHABLE_KEY}>
24
39
  <SignedIn>
25
40
  <div>Signed in</div>
26
41
  </SignedIn>
42
+
27
43
  <SignedOut>
28
44
  <SignInForm />
29
45
  </SignedOut>
@@ -32,14 +48,39 @@ export function App() {
32
48
  }
33
49
  ```
34
50
 
35
- ## Includes
51
+ ## What `DeploymentProvider` does
52
+
53
+ `DeploymentProvider` is the shared root for the client SDK. It:
54
+
55
+ - resolves deployment configuration from the `publicKey`
56
+ - exposes deployment-aware client state to the hooks
57
+ - powers navigation-aware auth components through the platform adapter
58
+ - lets you override deployment UI settings with `uiOverwrites` when you are embedding auth UI inside your own app
59
+
60
+ ## Main hook families
36
61
 
37
- - Components: `SignInForm`, `SignUpForm`, `UserButton`, `SignedIn`, `SignedOut`, etc.
38
- - Hooks: `useUser`, `useSession`, `useDeployment`, `useSignIn`, `useSignUp`, etc.
39
- - Permission helpers: `hasOrgPermission`, `hasWorkspacePermission`, `isOrgAdmin`, `isWorkspaceAdmin`
62
+ - state and context: `useDeployment`, `useClient`, `useSession`, `useUser`, `useNavigation`
63
+ - auth flows: `useSignIn`, `useSignUp`, `useSSOCallback`, `useMagicLinkVerification`, `useForgotPassword`, `useInvitation`, `useWaitlist`, `useUserSignins`
64
+ - multi tenancy: `useOrganizationList`, `useActiveOrganization`, `useWorkspaceList`, `useActiveWorkspace`, `useActiveTenancy`, `useOrganizationMemberships`, `useWorkspaceMemberships`
65
+ - notifications: `useNotifications`, `useNotificationStream`, `useNotificationUnreadCount`
66
+ - platform surfaces: agent, webhook, and API identity hooks
40
67
 
41
- For router-aware navigation behavior, use one of the framework adapters instead of raw `@wacht/jsx`.
68
+ ## Framework adapters
69
+
70
+ If you are already using one of the supported router integrations, prefer importing from the adapter package instead of `@wacht/jsx` directly:
71
+
72
+ - `@wacht/nextjs`
73
+ - `@wacht/react-router`
74
+ - `@wacht/tanstack-router`
75
+
76
+ Those packages re-export the shared JSX layer and add the framework-specific provider and server helpers.
77
+
78
+ ## Build
79
+
80
+ ```bash
81
+ pnpm build
82
+ ```
42
83
 
43
84
  ## License
44
85
 
45
- Licensed under the Apache License, Version 2.0. See [LICENSE.md](../LICENSE.md).
86
+ Apache License 2.0. See [LICENSE.md](../LICENSE.md).