@authowl/react 0.14.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/LICENSE +21 -0
- package/README.md +79 -0
- package/THIRD_PARTY_NOTICES.md +36 -0
- package/dist/index.cjs +8243 -0
- package/dist/index.d.cts +825 -0
- package/dist/index.d.ts +825 -0
- package/dist/index.js +8151 -0
- package/dist/styles.css +350 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AuthOwl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @authowl/react
|
|
2
|
+
|
|
3
|
+
React provider, hooks, and drop-in components for [AuthOwl](https://authowl.dev),
|
|
4
|
+
the multi-tenant auth service. Publishable-key based, zero CSS setup.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
pnpm add @authowl/react
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { AuthOwlProvider, GoogleOneTap, SignIn, useUser } from '@authowl/react';
|
|
12
|
+
import '@authowl/react/styles.css';
|
|
13
|
+
|
|
14
|
+
function App() {
|
|
15
|
+
return (
|
|
16
|
+
<AuthOwlProvider publishableKey={import.meta.env.VITE_AUTHOWL_PK} apiUrl="https://auth.yourdomain.com">
|
|
17
|
+
<GoogleOneTap />
|
|
18
|
+
<Page />
|
|
19
|
+
</AuthOwlProvider>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function Page() {
|
|
24
|
+
const { user, isLoaded, isSignedIn } = useUser();
|
|
25
|
+
if (!isLoaded) return null;
|
|
26
|
+
return isSignedIn ? <p>Hi, {user.email ?? user.phoneNumber}</p> : <SignIn />;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Components**: `<SignIn />`, `<SignUp />`, `<PhoneOTP />`, `<SocialButtons />`, `<MagicLinkForm />`,
|
|
31
|
+
`<EmailOtpForm />`, `<PasskeyButton />`, `<PasskeyManager />`, `<ForgotPassword />`,
|
|
32
|
+
`<ResetPassword />`, `<VerifyEmail />`, `<VerificationPending />`, `<MFAEnrollment />`,
|
|
33
|
+
`<MFAChallenge />`, `<Waitlist />`, `<ConsentGate />`, `<UserButton />`, `<SignOutButton />`,
|
|
34
|
+
`<SignedIn>`/`<SignedOut>`/`<Protect>`, `<AuthOwlBadge />`, `<UserProfile />`,
|
|
35
|
+
`<OrganizationSwitcher />`, `<OrganizationList />`, `<CreateOrganization />`,
|
|
36
|
+
`<OrganizationProfile />`, `<GoogleOneTap />`.
|
|
37
|
+
|
|
38
|
+
**Hooks**: `useUser`, `useSession`, `useSignIn`, `useSignUp`, `useSignOut`,
|
|
39
|
+
`usePasskeys`, `usePasswordReset`, `useEmailVerification`, `useMFA`, `useConsent`,
|
|
40
|
+
`usePublicConfig`, `useWaitlist`.
|
|
41
|
+
|
|
42
|
+
When the environment's acquisition mode is `waitlist`, `<SignUp />` automatically
|
|
43
|
+
renders email enrollment instead of account-creation methods. `<Waitlist />` is
|
|
44
|
+
also available as a standalone surface. Both use the same public endpoint,
|
|
45
|
+
privacy-safe accepted state, and action-bound Turnstile challenge.
|
|
46
|
+
|
|
47
|
+
The sign-up, sign-in, and account-management components also follow the
|
|
48
|
+
project's identity lifecycle policy. This includes separate sign-up and sign-in
|
|
49
|
+
permissions, username sign-in, optional username and first/last-name collection,
|
|
50
|
+
link or code email verification, passkey registration, email changes, account
|
|
51
|
+
deletion, and TOTP backup-code availability. Existing credentials remain
|
|
52
|
+
manageable even when creating another credential of that type is disabled.
|
|
53
|
+
|
|
54
|
+
When phone OTP is enabled, `<SignIn />` adds the localized phone flow automatically.
|
|
55
|
+
`<PhoneOTP />` is also available as a standalone surface. Production hosts must allow
|
|
56
|
+
Cloudflare Turnstile's challenge script in their Content Security Policy. Local and CI
|
|
57
|
+
servers use AuthOwl's documented dummy-token path when no public site key is configured.
|
|
58
|
+
|
|
59
|
+
When broad auth protection is enabled, the sign-in, sign-up, magic-link, email
|
|
60
|
+
OTP, password-reset, and verification components automatically run an
|
|
61
|
+
action-bound Turnstile challenge. Each attempt receives a fresh single-use token,
|
|
62
|
+
including retries, and provider failures are announced accessibly in English or
|
|
63
|
+
Arabic. No extra component wiring is required.
|
|
64
|
+
|
|
65
|
+
`<GoogleOneTap />` reads the enabled Google provider and its public OAuth client id from
|
|
66
|
+
project config, renders no DOM, and does nothing for an existing session. Hosts with a
|
|
67
|
+
Content Security Policy must allow Google Identity Services as documented in Google's
|
|
68
|
+
[CSP guide](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid#content_security_policy).
|
|
69
|
+
|
|
70
|
+
Publishable keys (`pk_test_…` in development, `pk_live_…` in production) are
|
|
71
|
+
safe to embed in client code. Durable session tokens live only in `HttpOnly` +
|
|
72
|
+
`Secure` + `SameSite=None` cookies. `useSession()` and `<UserProfile />` use
|
|
73
|
+
token-free session ids and safe device metadata.
|
|
74
|
+
|
|
75
|
+
See the full integration guide in the AuthOwl app repo (`INTEGRATION.md`).
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
`@authowl/react` bundles third-party components into its published `dist/`. Each
|
|
4
|
+
is redistributed under its own license, with the required copyright and
|
|
5
|
+
permission notices reproduced in full below, grouped by copyright holder. This
|
|
6
|
+
file is generated by `scripts/gen-notices.mjs`; do not edit by hand.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Kazuhiko Arase
|
|
11
|
+
|
|
12
|
+
License: MIT
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
MIT License
|
|
16
|
+
|
|
17
|
+
Copyright (c) 2009 Kazuhiko Arase
|
|
18
|
+
|
|
19
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
21
|
+
in the Software without restriction, including without limitation the rights
|
|
22
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
24
|
+
furnished to do so, subject to the following conditions:
|
|
25
|
+
|
|
26
|
+
The above copyright notice and this permission notice shall be included in all
|
|
27
|
+
copies or substantial portions of the Software.
|
|
28
|
+
|
|
29
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
+
SOFTWARE.
|
|
36
|
+
```
|