@useauthio/react 0.2.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/src/sign-in.ts ADDED
@@ -0,0 +1,263 @@
1
+ import { AuthioError } from "@useauthio/node";
2
+ import { authioFetch } from "./fetch";
3
+ import { isBrowser } from "./ssr";
4
+ import type { AuthioUser } from "./types";
5
+
6
+ export interface SignInWithMagicLinkOptions {
7
+ /** Authio auth-core base URL. */
8
+ apiUrl: string;
9
+ /** Project ID (`proj_…`). */
10
+ projectId: string;
11
+ /** Email address to send the magic-link to. */
12
+ email: string;
13
+ /**
14
+ * URL on the SPA the magic-link click-through should land on.
15
+ * Auth-core will redirect there with the access token in the URL
16
+ * after the user clicks the link in their inbox.
17
+ */
18
+ redirectUri: string;
19
+ signal?: AbortSignal;
20
+ fetch?: typeof fetch;
21
+ }
22
+
23
+ /**
24
+ * POSTs `/v1/auth/magic-link/send`. Top-level helper, intentionally
25
+ * not hook-bound — drop it directly into your form submit handler.
26
+ * Throws `AuthioError` on any failure (rate-limit, bad email,
27
+ * network down, etc.) so the caller can render the auth-core error
28
+ * code verbatim.
29
+ *
30
+ * Returns `void` on success — the link is now in the user's inbox.
31
+ * Show a "Check your email" screen and let the user click through.
32
+ *
33
+ * Example:
34
+ *
35
+ * ```ts
36
+ * try {
37
+ * await signInWithMagicLink({
38
+ * apiUrl: "https://auth-api.authio.com",
39
+ * projectId: "proj_123",
40
+ * email,
41
+ * redirectUri: `${window.location.origin}/auth/callback`,
42
+ * });
43
+ * setMessage("Check your email!");
44
+ * } catch (err) {
45
+ * if (err instanceof AuthioError) setError(err.message);
46
+ * }
47
+ * ```
48
+ */
49
+ export async function signInWithMagicLink(
50
+ opts: SignInWithMagicLinkOptions,
51
+ ): Promise<void> {
52
+ await authioFetch<{ ok?: boolean }>({
53
+ apiUrl: opts.apiUrl,
54
+ projectId: opts.projectId,
55
+ path: "/v1/auth/magic-link/send",
56
+ method: "POST",
57
+ body: {
58
+ email: opts.email,
59
+ redirect_uri: opts.redirectUri,
60
+ },
61
+ signal: opts.signal,
62
+ fetchImpl: opts.fetch,
63
+ });
64
+ }
65
+
66
+ export interface SignInWithPasskeyOptions {
67
+ apiUrl: string;
68
+ projectId: string;
69
+ /**
70
+ * Identifier hint for the passkey lookup. Optional — when omitted
71
+ * the user picks their key from the browser's native chooser.
72
+ */
73
+ email?: string;
74
+ signal?: AbortSignal;
75
+ fetch?: typeof fetch;
76
+ }
77
+
78
+ export interface SignInWithPasskeyResult {
79
+ accessToken: string;
80
+ refreshToken?: string;
81
+ user: AuthioUser;
82
+ }
83
+
84
+ interface PasskeyLoginOptionsResponse {
85
+ challenge: string;
86
+ rpId?: string;
87
+ timeout?: number;
88
+ userVerification?: PublicKeyCredentialRequestOptions["userVerification"];
89
+ allowCredentials?: Array<{
90
+ id: string;
91
+ type: string;
92
+ transports?: string[];
93
+ }>;
94
+ }
95
+
96
+ interface PasskeyLoginVerifyResponse {
97
+ access_token: string;
98
+ refresh_token?: string;
99
+ user: {
100
+ id: string;
101
+ email: string;
102
+ email_verified?: boolean;
103
+ emailVerified?: boolean;
104
+ name?: string;
105
+ avatar_url?: string;
106
+ avatarUrl?: string;
107
+ };
108
+ }
109
+
110
+ /**
111
+ * Runs the full WebAuthn assertion ceremony against auth-core:
112
+ *
113
+ * 1. `POST /v1/auth/passkey/login/options` to receive the
114
+ * `PublicKeyCredentialRequestOptions` shaped for this project.
115
+ * 2. `navigator.credentials.get({ publicKey: options })` to
116
+ * prompt the user for their authenticator (Touch ID, hardware
117
+ * key, platform key, etc.).
118
+ * 3. `POST /v1/auth/passkey/login/verify` with the resulting
119
+ * assertion → returns `{ access_token, refresh_token, user }`.
120
+ *
121
+ * Throws `AuthioError` on any step failure:
122
+ *
123
+ * - `not_in_browser` if `window`/`navigator` is missing (Vite SSR /
124
+ * test environment without jsdom).
125
+ * - `webauthn_unsupported` if `navigator.credentials.get` is
126
+ * missing (legacy browser).
127
+ * - `webauthn_cancelled` if the user dismisses the chooser.
128
+ * - Whatever auth-core returns on the options or verify call.
129
+ *
130
+ * The returned `refreshToken` is included for completeness, but the
131
+ * SDK never persists it — auth-core's `/v1/auth/passkey/login/verify`
132
+ * also sets the refresh cookie via `Set-Cookie`, which is the
133
+ * canonical storage. Callers should typically discard `refreshToken`.
134
+ */
135
+ export async function signInWithPasskey(
136
+ opts: SignInWithPasskeyOptions,
137
+ ): Promise<SignInWithPasskeyResult> {
138
+ if (!isBrowser() || typeof navigator === "undefined") {
139
+ throw new AuthioError({
140
+ code: "not_in_browser",
141
+ message:
142
+ "signInWithPasskey can only be invoked in a browser environment.",
143
+ status: 0,
144
+ });
145
+ }
146
+ if (!navigator.credentials || !navigator.credentials.get) {
147
+ throw new AuthioError({
148
+ code: "webauthn_unsupported",
149
+ message: "This browser does not support WebAuthn (passkeys).",
150
+ status: 0,
151
+ });
152
+ }
153
+
154
+ const options = await authioFetch<PasskeyLoginOptionsResponse>({
155
+ apiUrl: opts.apiUrl,
156
+ projectId: opts.projectId,
157
+ path: "/v1/auth/passkey/login/options",
158
+ method: "POST",
159
+ body: opts.email ? { email: opts.email } : {},
160
+ signal: opts.signal,
161
+ fetchImpl: opts.fetch,
162
+ });
163
+
164
+ const publicKey: PublicKeyCredentialRequestOptions = {
165
+ challenge: base64UrlToBuffer(options.challenge),
166
+ rpId: options.rpId,
167
+ timeout: options.timeout,
168
+ userVerification: options.userVerification,
169
+ allowCredentials: options.allowCredentials?.map((c) => ({
170
+ id: base64UrlToBuffer(c.id),
171
+ type: c.type as PublicKeyCredentialType,
172
+ transports: c.transports as AuthenticatorTransport[] | undefined,
173
+ })),
174
+ };
175
+
176
+ let credential: Credential | null;
177
+ try {
178
+ credential = await navigator.credentials.get({
179
+ publicKey,
180
+ signal: opts.signal,
181
+ });
182
+ } catch (err) {
183
+ throw new AuthioError({
184
+ code: "webauthn_cancelled",
185
+ message:
186
+ err instanceof Error
187
+ ? err.message
188
+ : "Passkey ceremony cancelled by user.",
189
+ status: 0,
190
+ });
191
+ }
192
+ if (!credential) {
193
+ throw new AuthioError({
194
+ code: "webauthn_cancelled",
195
+ message: "Passkey ceremony returned no credential.",
196
+ status: 0,
197
+ });
198
+ }
199
+
200
+ const assertion = credential as PublicKeyCredential & {
201
+ response: AuthenticatorAssertionResponse;
202
+ };
203
+ const verifyBody = {
204
+ id: assertion.id,
205
+ raw_id: bufferToBase64Url(assertion.rawId),
206
+ type: assertion.type,
207
+ response: {
208
+ client_data_json: bufferToBase64Url(assertion.response.clientDataJSON),
209
+ authenticator_data: bufferToBase64Url(
210
+ assertion.response.authenticatorData,
211
+ ),
212
+ signature: bufferToBase64Url(assertion.response.signature),
213
+ user_handle: assertion.response.userHandle
214
+ ? bufferToBase64Url(assertion.response.userHandle)
215
+ : null,
216
+ },
217
+ };
218
+
219
+ const verifyRes = await authioFetch<PasskeyLoginVerifyResponse>({
220
+ apiUrl: opts.apiUrl,
221
+ projectId: opts.projectId,
222
+ path: "/v1/auth/passkey/login/verify",
223
+ method: "POST",
224
+ body: verifyBody,
225
+ credentials: "include",
226
+ signal: opts.signal,
227
+ fetchImpl: opts.fetch,
228
+ });
229
+
230
+ return {
231
+ accessToken: verifyRes.access_token,
232
+ refreshToken: verifyRes.refresh_token,
233
+ user: {
234
+ id: verifyRes.user.id,
235
+ email: verifyRes.user.email,
236
+ emailVerified: Boolean(
237
+ verifyRes.user.emailVerified ?? verifyRes.user.email_verified,
238
+ ),
239
+ name: verifyRes.user.name,
240
+ avatarUrl: verifyRes.user.avatarUrl ?? verifyRes.user.avatar_url,
241
+ },
242
+ };
243
+ }
244
+
245
+ function base64UrlToBuffer(b64u: string): ArrayBuffer {
246
+ const padded = b64u
247
+ .replace(/-/g, "+")
248
+ .replace(/_/g, "/")
249
+ .padEnd(b64u.length + ((4 - (b64u.length % 4)) % 4), "=");
250
+ const bin = atob(padded);
251
+ const out = new Uint8Array(bin.length);
252
+ for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);
253
+ return out.buffer;
254
+ }
255
+
256
+ function bufferToBase64Url(buf: ArrayBuffer): string {
257
+ const bytes = new Uint8Array(buf);
258
+ let bin = "";
259
+ for (let i = 0; i < bytes.length; i++) {
260
+ bin += String.fromCharCode(bytes[i] as number);
261
+ }
262
+ return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
263
+ }
package/src/ssr.ts ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * SSR helpers. Every hook in this SDK is wrapped to be safe under
3
+ * Vite SSR / Remix / Next.js (where the provider is rendered server-
4
+ * side as a stub that hydrates client-side). The functions here are
5
+ * the single chokepoint for that — anywhere we touch `window`,
6
+ * `document`, `localStorage`, `navigator`, etc., gate on `isBrowser()`.
7
+ */
8
+
9
+ export function isBrowser(): boolean {
10
+ return typeof window !== "undefined" && typeof document !== "undefined";
11
+ }
12
+
13
+ export function isTabHidden(): boolean {
14
+ if (!isBrowser()) return false;
15
+ return document.visibilityState === "hidden";
16
+ }
17
+
18
+ /**
19
+ * Get the current URL (browser only). Falls back to `"/"` under SSR
20
+ * so callers can pass a non-empty default for redirect intentions.
21
+ */
22
+ export function currentUrl(fallback = "/"): string {
23
+ if (!isBrowser()) return fallback;
24
+ return window.location.href;
25
+ }
package/src/storage.ts ADDED
@@ -0,0 +1,98 @@
1
+ import { isBrowser } from "./ssr";
2
+ import type { AuthioStorageMode } from "./types";
3
+
4
+ /**
5
+ * Tiny abstraction over the four supported access-token storage
6
+ * backends. Refresh tokens are NEVER stored here — they live only
7
+ * in the BFF's HttpOnly cookie.
8
+ */
9
+ export interface TokenStorage {
10
+ get(): string | null;
11
+ set(value: string | null): void;
12
+ clear(): void;
13
+ }
14
+
15
+ class MemoryStorage implements TokenStorage {
16
+ private value: string | null = null;
17
+ get(): string | null {
18
+ return this.value;
19
+ }
20
+ set(value: string | null): void {
21
+ this.value = value;
22
+ }
23
+ clear(): void {
24
+ this.value = null;
25
+ }
26
+ }
27
+
28
+ class NoneStorage implements TokenStorage {
29
+ get(): string | null {
30
+ return null;
31
+ }
32
+ set(): void {
33
+ /* no-op */
34
+ }
35
+ clear(): void {
36
+ /* no-op */
37
+ }
38
+ }
39
+
40
+ class WebStorageBacking implements TokenStorage {
41
+ constructor(
42
+ private readonly storage: Storage,
43
+ private readonly key: string,
44
+ ) {}
45
+
46
+ get(): string | null {
47
+ try {
48
+ return this.storage.getItem(this.key);
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+
54
+ set(value: string | null): void {
55
+ try {
56
+ if (value === null) this.storage.removeItem(this.key);
57
+ else this.storage.setItem(this.key, value);
58
+ } catch {
59
+ // Quota / private-mode failure — swallow so the SDK keeps
60
+ // working without persistence rather than crashing the app.
61
+ }
62
+ }
63
+
64
+ clear(): void {
65
+ try {
66
+ this.storage.removeItem(this.key);
67
+ } catch {
68
+ /* see set() */
69
+ }
70
+ }
71
+ }
72
+
73
+ export const ACCESS_TOKEN_STORAGE_KEY = "authio.access_token";
74
+
75
+ /**
76
+ * Build the storage adapter the provider will use for the access
77
+ * token. Under SSR the `localStorage` / `sessionStorage` modes
78
+ * silently fall back to in-memory so the provider doesn't throw
79
+ * during a server render — the real storage kicks in after
80
+ * hydration.
81
+ */
82
+ export function createTokenStorage(
83
+ mode: AuthioStorageMode = "memory",
84
+ ): TokenStorage {
85
+ if (mode === "none") return new NoneStorage();
86
+ if (mode === "memory") return new MemoryStorage();
87
+ if (!isBrowser()) return new MemoryStorage();
88
+ if (mode === "localStorage") {
89
+ return new WebStorageBacking(window.localStorage, ACCESS_TOKEN_STORAGE_KEY);
90
+ }
91
+ if (mode === "sessionStorage") {
92
+ return new WebStorageBacking(
93
+ window.sessionStorage,
94
+ ACCESS_TOKEN_STORAGE_KEY,
95
+ );
96
+ }
97
+ return new MemoryStorage();
98
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Telemetry event union emitted by `@useauthio/react`. Pass
3
+ * `onTelemetryEvent` to `<AuthioProvider>` to capture these — wire
4
+ * them into Sentry / Datadog / your observability stack of choice.
5
+ *
6
+ * The SDK does not phone home by default. If `onTelemetryEvent` is
7
+ * omitted, every event is dropped.
8
+ *
9
+ * All events carry a millisecond `timestamp` taken from `Date.now()`
10
+ * at emit. Additional fields per kind:
11
+ *
12
+ * - `refresh_succeeded`: a silent refresh against `/v1/auth/refresh`
13
+ * produced a fresh, verified access token.
14
+ * - `refresh_failed`: refresh attempt failed — either the network
15
+ * call rejected, the response was malformed, or token
16
+ * verification rejected the new token. `reason` is human-readable;
17
+ * `status` is the HTTP status (or `undefined` on network errors);
18
+ * `attempt` is the 0-indexed retry count for this scheduled
19
+ * refresh.
20
+ * - `refresh_scheduled`: a future silent refresh has been timer-
21
+ * scheduled. `runAt` is the unix millisecond at which the refresh
22
+ * will fire (subject to the visibilitychange deferral).
23
+ * - `sign_in_started` / `sign_in_completed` / `sign_in_failed`: the
24
+ * three terminal states of a sign-in attempt. `method` says which
25
+ * surface initiated it.
26
+ * - `sign_out`: the user clicked sign-out; emitted after the local
27
+ * cookie + token state has been cleared, regardless of whether
28
+ * the upstream `POST /v1/auth/sign-out` returned 2xx.
29
+ * - `token_verified`: a token passed signature verification. The
30
+ * `subject` is the verified `sub` claim.
31
+ * - `token_rejected`: a token failed verification; the SDK has
32
+ * already discarded it. `reason` is the verifier's error
33
+ * message.
34
+ */
35
+ export type AuthioTelemetryEvent =
36
+ | { kind: "refresh_succeeded"; timestamp: number; expiresAt?: number }
37
+ | {
38
+ kind: "refresh_failed";
39
+ timestamp: number;
40
+ reason: string;
41
+ status?: number;
42
+ attempt: number;
43
+ }
44
+ | { kind: "refresh_scheduled"; timestamp: number; runAt: number }
45
+ | {
46
+ kind: "sign_in_started";
47
+ timestamp: number;
48
+ method: "magic_link" | "passkey" | "redirect";
49
+ }
50
+ | {
51
+ kind: "sign_in_completed";
52
+ timestamp: number;
53
+ method: "magic_link" | "passkey" | "redirect";
54
+ }
55
+ | {
56
+ kind: "sign_in_failed";
57
+ timestamp: number;
58
+ method: "magic_link" | "passkey" | "redirect";
59
+ reason: string;
60
+ }
61
+ | { kind: "sign_out"; timestamp: number }
62
+ | { kind: "token_verified"; timestamp: number; subject: string }
63
+ | { kind: "token_rejected"; timestamp: number; reason: string };
64
+
65
+ export type TelemetryEmitter = (event: AuthioTelemetryEvent) => void;
66
+
67
+ export const noopEmitter: TelemetryEmitter = () => {};
package/src/types.ts ADDED
@@ -0,0 +1,132 @@
1
+ import type { ReactNode } from "react";
2
+ import type { AuthioTelemetryEvent } from "./telemetry";
3
+
4
+ /**
5
+ * Minimal user shape consumed by `@useauthio/react`. We deliberately
6
+ * keep this lean so the SPA doesn't need to know about org pivots,
7
+ * memberships, etc. Customers that need richer data fetch
8
+ * `/v1/users/me` (or similar) from their own UI layer using
9
+ * `getAccessToken()`.
10
+ */
11
+ export interface AuthioUser {
12
+ id: string;
13
+ email: string;
14
+ emailVerified: boolean;
15
+ name?: string;
16
+ avatarUrl?: string;
17
+ }
18
+
19
+ /**
20
+ * The provider walks through three states:
21
+ * - `loading` — initial mount; we're trying to refresh
22
+ * against the BFF cookie before showing UI.
23
+ * - `authenticated` — a verified access token is in memory.
24
+ * - `unauthenticated` — no session; show your sign-in surface.
25
+ */
26
+ export type AuthioStatus = "loading" | "authenticated" | "unauthenticated";
27
+
28
+ export type AuthioStorageMode =
29
+ | "memory"
30
+ | "localStorage"
31
+ | "sessionStorage"
32
+ | "none";
33
+
34
+ export interface AuthioContextValue {
35
+ user: AuthioUser | null;
36
+ status: AuthioStatus;
37
+ accessToken: string | null;
38
+ /**
39
+ * Returns the current access token, silently refreshing if it's
40
+ * within 10 seconds of expiry. Returns `null` when no session
41
+ * is available (the caller should `signIn()` or show the
42
+ * unauthenticated UI).
43
+ */
44
+ getAccessToken: () => Promise<string | null>;
45
+ /**
46
+ * Navigates the tab to the auth-core hosted sign-in UI. Pass
47
+ * `returnTo` to specify the URL the user lands back on after
48
+ * sign-in completes; defaults to the current `window.location.href`.
49
+ */
50
+ signIn: (opts?: { returnTo?: string }) => void;
51
+ /**
52
+ * Best-effort revokes the session against auth-core and clears
53
+ * the local in-memory / web-storage access token.
54
+ */
55
+ signOut: () => Promise<void>;
56
+ /**
57
+ * Forces a refresh now. Resolves `true` on success (state is
58
+ * authenticated), `false` on failure (state is unauthenticated).
59
+ */
60
+ refresh: () => Promise<boolean>;
61
+ }
62
+
63
+ /** Result of a single JWT verification attempt. */
64
+ export interface AuthioTokenVerification {
65
+ /** The verified token's subject (`sub` claim). */
66
+ subject: string;
67
+ /** Optional expiry (unix seconds) — used to schedule the next refresh. */
68
+ expiresAt?: number;
69
+ }
70
+
71
+ export type AuthioTokenVerifier = (
72
+ token: string,
73
+ ) => Promise<AuthioTokenVerification | null>;
74
+
75
+ export interface AuthioProviderProps {
76
+ /** Authio auth-core base URL, e.g. `"https://auth-api.authio.com"`. */
77
+ apiUrl: string;
78
+ /** Project ID (`proj_…`). Sent as `X-Authio-Project` on every call. */
79
+ projectId: string;
80
+ /**
81
+ * Where the access token lives. Defaults to `"memory"`. NEVER stores
82
+ * the refresh token in JS-accessible storage regardless of this
83
+ * setting — the refresh token rides only the BFF cookie. See
84
+ * README §Security considerations for the XSS-tradeoff discussion
85
+ * around `localStorage` and `sessionStorage`.
86
+ */
87
+ storage?: AuthioStorageMode;
88
+ /**
89
+ * How many seconds before `exp` to schedule the silent refresh.
90
+ * Defaults to 60. The refresh fires lazily — if the tab is hidden
91
+ * we defer until `visibilitychange` so we don't waste battery on
92
+ * a background tab.
93
+ */
94
+ refreshLeadSeconds?: number;
95
+ /**
96
+ * Optional sink for SDK telemetry (refresh outcomes, sign-in
97
+ * starts/completes, token verification results). Useful for
98
+ * Sentry / Datadog wiring. The SDK never phones home by default —
99
+ * if you don't pass this, no events are emitted.
100
+ */
101
+ onTelemetryEvent?: (event: AuthioTelemetryEvent) => void;
102
+ /** Inject a custom `fetch` implementation. Defaults to `globalThis.fetch`. */
103
+ fetch?: typeof fetch;
104
+ /**
105
+ * Override the Lobby (hosted UI) sign-in URL. Defaults to
106
+ * `https://lobby.authio.com/`. Customers running a custom Authio
107
+ * domain (e.g. `auth.acme.com`) point this at their hosted UI.
108
+ */
109
+ signInUrl?: string;
110
+ /**
111
+ * JWT issuer to require during verification. Defaults to `apiUrl`.
112
+ * Auth-core mints tokens with `iss` set to its own public origin.
113
+ */
114
+ jwtIssuer?: string;
115
+ /** JWT audience to require. Defaults to `"authio"`. */
116
+ jwtAudience?: string;
117
+ /**
118
+ * Override the JWT verification step. Default uses `JwtVerifier`
119
+ * from `@useauthio/node` (EdDSA-pinned, refuses `alg: none`). Pass a
120
+ * custom verifier for tests or to use a pre-distributed JWKS.
121
+ * Failure (resolved `null` or thrown) discards the token and
122
+ * transitions to `unauthenticated`.
123
+ */
124
+ verifyToken?: AuthioTokenVerifier;
125
+ /**
126
+ * When `true`, skips the initial refresh attempt on mount and
127
+ * starts in the `unauthenticated` state. Useful in tests and in
128
+ * SSR-rendered pages that hydrate without a session.
129
+ */
130
+ skipInitialRefresh?: boolean;
131
+ children: ReactNode;
132
+ }
package/src/version.ts ADDED
@@ -0,0 +1,4 @@
1
+ /** Published @useauthio/react version — keep in sync with package.json. */
2
+ export const SDK_VERSION = "0.2.0";
3
+
4
+ export const SDK_USER_AGENT = `react/${SDK_VERSION}` as const;
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Authio
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.