{"_id":"@agenticprimitives/browser-identity","_rev":"4-44523661fb85e69777db8ec03256a5ec","name":"@agenticprimitives/browser-identity","dist-tags":{"alpha":"1.0.0-alpha.6","latest":"1.0.0-alpha.9"},"versions":{"1.0.0-alpha.6":{"name":"@agenticprimitives/browser-identity","version":"1.0.0-alpha.6","keywords":["fedcm","browser-identity","federation","sign-in","adapter","agentic"],"license":"MIT","_id":"@agenticprimitives/browser-identity@1.0.0-alpha.6","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/browser-identity","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"566afe78c059b46a930ac36cbab4f1c197dc7665","tarball":"https://registry.npmjs.org/@agenticprimitives/browser-identity/-/browser-identity-1.0.0-alpha.6.tgz","fileCount":8,"integrity":"sha512-3G14lHcq/ZUDvA8uhQedVdPJ/wclly4IrTSzCYZbqYDwE9rN1QijB5Euz6EDPkvZx4WPGf+gcLMz9VEUgmDF/Q==","signatures":[{"sig":"MEUCIQDuDC9k1W3aqKBvP7Meq7dJmYtmiaa55UJhJ3543Vpq6gIgV0NkJMS67k0RLfz5mRWsHr9uuNa+MBUR4qJBWUd3gps=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14302},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-browser-identity-1.0.0-alpha.6.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest","test:integration":"vitest run test/integration --passWithNoTests"},"_npmUser":{"name":"richcanvas","email":"richardpedersen3@gmail.com"},"_resolved":"/tmp/claude-1000/8f3f0573da15f63afc70806f001c33e7/agenticprimitives-browser-identity-1.0.0-alpha.6.tgz","_integrity":"sha512-3G14lHcq/ZUDvA8uhQedVdPJ/wclly4IrTSzCYZbqYDwE9rN1QijB5Euz6EDPkvZx4WPGf+gcLMz9VEUgmDF/Q==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/browser-identity"},"_npmVersion":"11.16.0","description":"Browser sign-in adapter seam: feature-detect FedCM and choose the browser-native path vs the guaranteed fallback. FedCM-first, not FedCM-only (ADR-0031).","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@types/node":"^22.7.0"},"_npmOperationalInternal":{"tmp":"tmp/browser-identity_1.0.0-alpha.6_1781153956658_0.7557124661636982","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.7":{"name":"@agenticprimitives/browser-identity","version":"1.0.0-alpha.7","keywords":["fedcm","browser-identity","federation","sign-in","adapter","agentic"],"license":"MIT","_id":"@agenticprimitives/browser-identity@1.0.0-alpha.7","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/browser-identity","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"d99f47402e245354dad4b3370e44c2e1f4f4b733","tarball":"https://registry.npmjs.org/@agenticprimitives/browser-identity/-/browser-identity-1.0.0-alpha.7.tgz","fileCount":8,"integrity":"sha512-E4qI/oHMZTs+zouks0zRQb6LblhBJawXWOdhWH/3pGlAgurEDnO2AZ7Jpprwq5oQzPB7QdkAFEkvubhUHTTgVA==","signatures":[{"sig":"MEQCIBlPRjCfVH3k4XEeP1NEJ5Z5rgRLXZxY6SiHBzZH2ufYAiB0MiygqVMFnzLcKTARE874Ptvg+Nwoy0eSsO8asQOfSA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQChhIRiAi7gTnXva/fL+g9y8d91o6eBUwLyAuvKmX6ongIhAL7rjYL/gzMFXjfFrfR/HbwO4cRDte+np33L1KjNc8tP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14302},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-browser-identity-1.0.0-alpha.7.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest","test:integration":"vitest run test/integration --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3fcfe53b-9a79-4128-8d04-2adc26c4620a"}},"_resolved":"/tmp/e520b90269739a23ef3d894cde1e4952/agenticprimitives-browser-identity-1.0.0-alpha.7.tgz","_integrity":"sha512-E4qI/oHMZTs+zouks0zRQb6LblhBJawXWOdhWH/3pGlAgurEDnO2AZ7Jpprwq5oQzPB7QdkAFEkvubhUHTTgVA==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/browser-identity"},"_npmVersion":"11.19.0","description":"Browser sign-in adapter seam: feature-detect FedCM and choose the browser-native path vs the guaranteed fallback. FedCM-first, not FedCM-only (ADR-0031).","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@types/node":"^22.7.0"},"_npmOperationalInternal":{"tmp":"tmp/browser-identity_1.0.0-alpha.7_1789164142362_0.7150361345507354","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.8":{"name":"@agenticprimitives/browser-identity","version":"1.0.0-alpha.8","keywords":["fedcm","browser-identity","federation","sign-in","adapter","agentic"],"license":"MIT","_id":"@agenticprimitives/browser-identity@1.0.0-alpha.8","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/browser-identity","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"f547483de4bb6cd67c4e031eb2770a1ec871d24b","tarball":"https://registry.npmjs.org/@agenticprimitives/browser-identity/-/browser-identity-1.0.0-alpha.8.tgz","fileCount":8,"integrity":"sha512-VPermK6O2tJ/2/JGgxaDxmb/ZVXRGbux7PJDISqflw39GBBtzqKb/T9FxvFXCxSlFcUiJC9XnzTKhaj53rVIpg==","signatures":[{"sig":"MEUCIQDlsM97XQ9CdFCAQHHi7rBRCnwXNgXjFo1HYoY7vNBp+AIgAgQSdObRozy8TtNZjD9mvkmwCOF6C/gBmT/q5QJ4xsg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDpWUs07Tz4BxnORSCrappaOrz1BBqBj2RDMqezcXKlDwIgfhNVaMH9lXoMg5ZMv1pHz00RwGyvyeKlm6iW26ZoKKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14302},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-browser-identity-1.0.0-alpha.8.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest","test:integration":"vitest run test/integration --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3fcfe53b-9a79-4128-8d04-2adc26c4620a"}},"_resolved":"/tmp/5be41af1f8a320b39a5190b3815a8cce/agenticprimitives-browser-identity-1.0.0-alpha.8.tgz","_integrity":"sha512-VPermK6O2tJ/2/JGgxaDxmb/ZVXRGbux7PJDISqflw39GBBtzqKb/T9FxvFXCxSlFcUiJC9XnzTKhaj53rVIpg==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/browser-identity"},"_npmVersion":"11.19.0","description":"Browser sign-in adapter seam: feature-detect FedCM and choose the browser-native path vs the guaranteed fallback. FedCM-first, not FedCM-only (ADR-0031).","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@types/node":"^22.7.0"},"_npmOperationalInternal":{"tmp":"tmp/browser-identity_1.0.0-alpha.8_1789230585111_0.07360310015918614","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.9":{"_id":"@agenticprimitives/browser-identity@1.0.0-alpha.9","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"e319933ecbe2e716e0ae161d9f7c66fafc50b4e3","tarball":"https://registry.npmjs.org/@agenticprimitives/browser-identity/-/browser-identity-1.0.0-alpha.9.tgz","fileCount":8,"integrity":"sha512-TA7NfXg1T//C4ZWOVCbV67oKb6YPNR5jiqXjZM9m9Q2BBNwzCJOGNdt1Um3mWazxtYRRGrOejMPaeJjHUDakTg==","signatures":[{"sig":"MEUCIQC0Rabf3ikzdpFzl5qJdA2VRKBgTlYwTMKsJII3rlk54gIgOGPwRa48NzuZ7LdkfZ9Mzmb48IAr/K7Y2kkDV9BMaRY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICKYN9xatJfpWzIQuy9df9GWwHmtbPt/eSDZLYy8/NfyAiEA4OKru+u23ag4BJYwb/+DTAykbts9zZkIr1pYfsNjwCo="}],"unpackedSize":14792},"main":"./dist/index.js","name":"@agenticprimitives/browser-identity","type":"module","_from":"file:agenticprimitives-browser-identity-1.0.0-alpha.9.tgz","types":"./dist/index.d.ts","author":{"url":"https://agenticprimitives.dev","name":"Agentic Trust Labs"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"MIT","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest","test:integration":"vitest run test/integration --passWithNoTests"},"version":"1.0.0-alpha.9","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3fcfe53b-9a79-4128-8d04-2adc26c4620a"}},"homepage":"https://agenticprimitives.dev","keywords":["fedcm","browser-identity","federation","sign-in","adapter","agentic","agentic-primitives","agenticprimitives","ai-agents","agent-authority","agentic-trust"],"_resolved":"/tmp/a2b081c0316bbbf47821ecf73412abc6/agenticprimitives-browser-identity-1.0.0-alpha.9.tgz","_integrity":"sha512-TA7NfXg1T//C4ZWOVCbV67oKb6YPNR5jiqXjZM9m9Q2BBNwzCJOGNdt1Um3mWazxtYRRGrOejMPaeJjHUDakTg==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/browser-identity"},"_npmVersion":"11.19.0","description":"Browser sign-in adapter seam: feature-detect FedCM and choose the browser-native path vs the guaranteed fallback. FedCM-first, not FedCM-only (ADR-0031).","directories":{},"maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@types/node":"^22.7.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/browser-identity_1.0.0-alpha.9_1789814901179_0.4093844179718582"}}},"time":{"created":"2026-06-11T04:59:16.456Z","modified":"2026-09-19T10:48:21.454Z","1.0.0-alpha.6":"2026-06-11T04:59:16.799Z","1.0.0-alpha.7":"2026-09-11T22:02:22.459Z","1.0.0-alpha.8":"2026-09-12T16:29:45.212Z","1.0.0-alpha.9":"2026-09-19T10:48:21.263Z"},"bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"license":"MIT","homepage":"https://agenticprimitives.dev","keywords":["fedcm","browser-identity","federation","sign-in","adapter","agentic","agentic-primitives","agenticprimitives","ai-agents","agent-authority","agentic-trust"],"repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/browser-identity"},"description":"Browser sign-in adapter seam: feature-detect FedCM and choose the browser-native path vs the guaranteed fallback. FedCM-first, not FedCM-only (ADR-0031).","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"readme":"# @agenticprimitives/browser-identity\n\n> Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)\n\n**Adopt browser-native sign-in the day your users' browsers support it — without betting your auth flow on it.**\n\nFedCM is how browsers want federated login to work: no third-party cookies, no redirect dance, a native account chooser. It is also MDN \"Limited availability\" — building on it exclusively strands every non-Chromium user. `browser-identity` is the adapter seam that resolves the tension: it feature-detects the browser's FedCM API and chooses the browser-native path when available, otherwise a guaranteed fallback. **FedCM-first, not FedCM-only** ([ADR-0031](https://github.com/agentictrustlabs/agenticprimitives/blob/master/docs/architecture/decisions/0031-fedcm-and-browser-credential-apis-are-adapters.md); [spec 264](https://github.com/agentictrustlabs/agenticprimitives/blob/master/specs/264-fedcm-idp-adapter.md)).\n\nThe deeper design point: browser credential APIs (FedCM, WebAuthn, the Digital Credentials API, OAuth/OIDC, SIWE) are *adapters* over the agenticprimitives authority substrate — not the substrate. Sign-in proves who showed up; the capability/delegation object that says what the agent may do is issued by the substrate *after* sign-in, never smuggled into a browser credential. This package owns only the generic, transport-agnostic **selector + feature-detect**; the concrete sign-in strategies are **injected by the consumer**.\n\n> Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.\n\n## Install\n\n```bash\nnpm install @agenticprimitives/browser-identity\n```\n\n## Usage\n\n```ts\nimport { chooseSignIn, fedcmAvailable } from '@agenticprimitives/browser-identity';\n\n// The app injects its own strategies; this package only chooses between them and never inspects T.\nconst result = await chooseSignIn({\n  // Phase 1+: the FedCM RP path (navigator.credentials.get({ identity })). Omit it until wired —\n  // the fallback runs, so the seam is in place with zero behaviour change (Phase 0).\n  // fedcm: () => fedcmSignIn(providers),\n  fallback: () => startConnectPopup(),  // the guaranteed home popup/redirect (spec 259)\n});\n\nif (fedcmAvailable()) {\n  // ... progressive enhancement when the browser supports FedCM\n}\n```\n\n### `chooseSignIn(options)`\n\n| Option | Type | Notes |\n| --- | --- | --- |\n| `fallback` | `() => Promise<T>` | **Required.** The path that works in every browser (spec 259). |\n| `fedcm` | `() => Promise<T>` | Optional. The browser-native FedCM path; run only when supported. |\n| `prefer` | `'auto' \\| 'fedcm' \\| 'fallback'` | `'auto'` (default) feature-detects; the others pin a path (tests, opt-out, staged rollout). |\n\nReturns the consumer's own result type `T` — this package is agnostic to its shape.\n\n### `fedcmAvailable()`\n\nReturns `true` only when `navigator.credentials.get` and the FedCM `IdentityCredential` interface are\npresent. SSR-safe (returns `false` off the browser). FedCM is MDN \"Limited availability,\" so a `false`\nhere is expected on many browsers — the fallback handles them.\n\n## How it's different\n\nMost FedCM integrations are written directly against `navigator.credentials.get` inside one app, which couples the auth flow to a still-moving browser API. This package is the deliberately small alternative:\n\n- **The seam is free.** With no `fedcm` strategy provided, `chooseSignIn` runs the fallback — zero behaviour change versus calling your launcher directly. You can ship the seam today and inject the real FedCM strategy (see [`fedcm-rp`](../fedcm-rp)) when ready.\n- **No opinion about your result type.** Strategies return your `T`; the selector never inspects it. It composes with any session shape, including the substrate's `AgentSession`.\n- **Identity bootstrap only.** Authority — what the signed-in agent may do — comes from the substrate's delegation layer afterward, so a browser API change can never widen permissions.\n\n## Boundaries\n\nGeneric + transport-agnostic ([ADR-0021](https://github.com/agentictrustlabs/agenticprimitives/blob/master/docs/architecture/decisions/0021-generic-packages-vs-white-label-apps.md)):\nno app imports, no transport SDKs, no concrete hostnames. The FedCM **IdP endpoint hosting** + the\naccount list live in the consuming app, not here.\n\n## Status\n\nThis package is intentionally minimal — the spec-264 Phase 0 seam (selector + feature-detect); concrete FedCM strategies live in [`fedcm-rp`](../fedcm-rp) and are injected per Phase 1. Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).\n\n## Validate\n\n```bash\npnpm --filter @agenticprimitives/browser-identity build\npnpm --filter @agenticprimitives/browser-identity test\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","author":{"url":"https://agenticprimitives.dev","name":"Agentic Trust Labs"}}