@wacht/jsx 1.0.0-beta.2 → 1.0.0-beta.3
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 +37 -18
- package/dist/index.cjs.js +64 -64
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +3228 -3203
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<a href="https://wacht.dev" style="text-decoration:none;">@wacht/jsx</a>
|
|
3
|
+
</h1>
|
|
2
4
|
|
|
3
|
-
Core React
|
|
5
|
+
<p align="center">Core React primitives for Wacht authentication, session state, organization/workspace context, and product surface hooks.</p>
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://docs.wacht.dev">Documentation</a> |
|
|
9
|
+
<a href="https://www.npmjs.com/package/@wacht/jsx">npm</a>
|
|
10
|
+
</p>
|
|
9
11
|
|
|
10
12
|
## Install
|
|
11
13
|
|
|
@@ -13,17 +15,15 @@ Use this package directly for framework-agnostic React apps, or through:
|
|
|
13
15
|
pnpm add @wacht/jsx @wacht/types
|
|
14
16
|
```
|
|
15
17
|
|
|
16
|
-
##
|
|
18
|
+
## Quick start
|
|
17
19
|
|
|
18
20
|
```tsx
|
|
19
|
-
import { DeploymentProvider,
|
|
21
|
+
import { DeploymentProvider, SignedIn, SignedOut, SignInForm } from "@wacht/jsx";
|
|
20
22
|
|
|
21
23
|
export function App() {
|
|
22
24
|
return (
|
|
23
|
-
<DeploymentProvider publicKey={
|
|
24
|
-
<SignedIn>
|
|
25
|
-
<div>Signed in</div>
|
|
26
|
-
</SignedIn>
|
|
25
|
+
<DeploymentProvider publicKey={import.meta.env.VITE_WACHT_PUBLISHABLE_KEY}>
|
|
26
|
+
<SignedIn>Signed in</SignedIn>
|
|
27
27
|
<SignedOut>
|
|
28
28
|
<SignInForm />
|
|
29
29
|
</SignedOut>
|
|
@@ -32,14 +32,33 @@ export function App() {
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Main exports
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
- Hooks: `useUser`, `useSession`, `useDeployment`, `useSignIn`, `useSignUp`, etc.
|
|
39
|
-
- Permission helpers: `hasOrgPermission`, `hasWorkspacePermission`, `isOrgAdmin`, `isWorkspaceAdmin`
|
|
37
|
+
Components:
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
- Auth UI: `SignInForm`, `SignUpForm`, `WaitlistForm`, `SSOCallback`, `MagicLinkVerification`
|
|
40
|
+
- Session and navigation: `SignedIn`, `SignedOut`, `SignedInAccounts`, `NavigateToSignIn`
|
|
41
|
+
- User/account: `UserButton`, `UserControls`, `ManageAccount`
|
|
42
|
+
- Notifications: `NotificationBell`, `NotificationPopover`, `NotificationPanel`
|
|
43
|
+
|
|
44
|
+
Hooks:
|
|
45
|
+
|
|
46
|
+
- Auth/session: `useUser`, `useSession`, `useSignIn`, `useSignUp`, `useForgotPassword`
|
|
47
|
+
- Tenancy: `useActiveOrganization`, `useActiveWorkspace`, `useActiveTenancy`
|
|
48
|
+
- Notifications: `useNotifications`, `useNotificationStream`, `useScopeUnread`
|
|
49
|
+
- Agent/webhook/api-auth surfaces: `useAgentSession`, `useWebhookEndpoints`, `useApiAuthKeys`, and related hooks
|
|
50
|
+
|
|
51
|
+
Utilities:
|
|
52
|
+
|
|
53
|
+
- Permission helpers (organization/workspace)
|
|
54
|
+
- URL safety helpers
|
|
55
|
+
|
|
56
|
+
## Build
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm build
|
|
60
|
+
```
|
|
42
61
|
|
|
43
62
|
## License
|
|
44
63
|
|
|
45
|
-
|
|
64
|
+
Apache License 2.0. See [LICENSE.md](../LICENSE.md).
|