passkeyflow 0.0.1

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 ADDED
@@ -0,0 +1,24 @@
1
+ <div align="center">
2
+
3
+ # Passkey Flow
4
+
5
+ ### Small composed flow primitives for passkey authentication.
6
+
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![Module](https://img.shields.io/badge/module-ESM-f7df1e?logo=javascript&logoColor=111827)](package.json) [![Status](https://img.shields.io/badge/status-in%20development-f5a623)](https://auth.mosa.sh)
8
+
9
+ [auth.mosa.sh](https://auth.mosa.sh) · [mosa.sh](https://mosa.sh)
10
+
11
+ </div>
12
+
13
+ Passkey Flow provides a tiny framework-neutral state primitive for composing
14
+ passkey registration and authentication experiences.
15
+
16
+ ```sh
17
+ npm i passkeyflow
18
+ ```
19
+
20
+ ```ts
21
+ import { createPasskeyFlow } from "passkeyflow";
22
+
23
+ createPasskeyFlow("challenging");
24
+ ```
@@ -0,0 +1,7 @@
1
+ export type PasskeyFlowStatus = "idle" | "challenging" | "complete" | "failed";
2
+ export interface PasskeyFlowState {
3
+ status: PasskeyFlowStatus;
4
+ error?: string;
5
+ }
6
+ /** Creates a minimal immutable passkey flow state for UI or orchestration layers. */
7
+ export declare function createPasskeyFlow(status?: PasskeyFlowStatus, error?: string): PasskeyFlowState;
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ /** Creates a minimal immutable passkey flow state for UI or orchestration layers. */
2
+ export function createPasskeyFlow(status = "idle", error) {
3
+ if (status !== "failed" && error)
4
+ throw new TypeError("Only failed passkey flows may carry an error.");
5
+ return error ? { status, error } : { status };
6
+ }
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "passkeyflow",
3
+ "version": "0.0.1",
4
+ "description": "Small composed flow primitives for passkey authentication.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } },
9
+ "files": ["dist", "README.md"],
10
+ "sideEffects": false,
11
+ "scripts": { "build": "tsc --project tsconfig.json", "prepublishOnly": "npm run build" },
12
+ "keywords": ["passkey", "webauthn", "flow", "authentication"],
13
+ "homepage": "https://auth.mosa.sh",
14
+ "author": "Mosanic <dev@mosanic.io>",
15
+ "license": "MIT",
16
+ "engines": { "node": ">=20" },
17
+ "publishConfig": { "access": "public" },
18
+ "devDependencies": { "typescript": "^5.9.3" }
19
+ }