{
  "slug": "playwright-browsercontext-credentials-registers-virtual-passkeys-808561153626",
  "title": "Playwright browserContext.credentials registers virtual passkeys",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-15T10:05:19.000Z",
  "announced_at": "2026-06-15T10:05:19.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When testing a passkey login without a physical key, seed a virtual credential in the browser context, install the authenticator before navigation, then open the login page.",
    "examples": [
      "const context = await browser.newContext();\nawait context.credentials.create('example.com', {\n  id: '<credentialId>',\n  userHandle: '<userHandle>',\n  privateKey: '<privateKey>',\n  publicKey: '<publicKey>',\n});\nawait context.credentials.install();\nconst page = await context.newPage();\nawait page.goto('https://example.com/login');",
      "const context = await browser.newContext();\nawait context.credentials.install();\nconst page = await context.newPage();\nawait page.goto('https://example.com/register');\nawait page.getByRole('button', { name: 'Create a passkey' }).click();\nconst [credential] = await context.credentials.get({ rpId: 'example.com' });",
      "const context = await browser.newContext();\nawait context.credentials.create('<rpId>', <credential>);\nawait context.credentials.install();\nconst page = await context.newPage();\nawait page.goto('https://example.com/login');"
    ],
    "gotchas": [
      "Version: v1.61.0",
      "rpId (required): Relying party ID, typically the site's effective domain.",
      "options.id: Base64url credential ID; auto-generated if omitted.",
      "options.userHandle: Base64url user handle; auto-generated if omitted.",
      "options.privateKey: Base64url PKCS#8 (DER) private key; auto-generated if omitted.",
      "options.publicKey: Base64url SPKI (DER) public key; auto-generated if omitted.",
      "credentials.install() (required): Takes no parameters; installs interception for page WebAuthn calls. Call before the page first uses WebAuthn.",
      "Prerequisite: Use Playwright v1.61 or later; the credentials API was added in v1.61.",
      "Prerequisite: Call credentials.install() before navigating to a page that uses WebAuthn; otherwise seeded credentials are not exposed to the page.",
      "No real hardware key is required.",
      "Works in all browsers."
    ]
  },
  "why_it_matters": "Test a passkey login flow in a browser context without a physical security key.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.61.0",
    "https://playwright.dev/docs/api/class-credentials"
  ],
  "rank": 0.99028,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-3081afb6e04abdfe-0:gate",
    "evidence_hash": "dbcfef8a253ec929beeebe114951631317990b1153dd7838e6ec906812e39e91"
  },
  "review": {
    "draft_hash": "acf5d9feaa45f0734a74c9736ac8faa846fd847b3dcfd732c1b0417092fcc0de",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.99 >= 0.9; 2 needed) and Jev gave 0.75 (>= 0.6 needed)."
  }
}
