BrowserContext storage state includes virtual WebAuthn credentials
Introduced 2026-07-24 · score 0.92
HOW TO USE IT
When saving a context that has virtual WebAuthn credentials, call `storageState({ credentials: true })` to include them. Restore that state in a later context with `storageState` or `setStorageState`; restoration installs the virtual authenticator and disables real authenticators in that context.
await context.storageState({ credentials: true, path: 'state.json' });const context = await browser.newContext({ storageState: 'state.json' });await context.setStorageState('state.json');WHY THIS HELPS
Persist virtual WebAuthn credentials so a later browser context can be seeded with them.
REQUIREMENTS AND LIMITATIONS
- Version: v1.62.0
- credentials: Boolean option for `storageState`; set to `true` to include virtual WebAuthn credentials in the snapshot.
- path: File path for saving the state; if omitted, the state is returned but not saved to disk.
- storageState: `browser.newContext` option containing a state file path or state object to initialize the context.
- storageState (required): Argument to `setStorageState`; path or state object to apply to the existing context.
- Prerequisite: Use Playwright v1.62.0 or later for the release-note change.
- Prerequisite: Restoring state with credentials automatically installs the virtual WebAuthn authenticator; real authenticators will not work in that context.
- The option includes the context's virtual WebAuthn credentials (passkeys) in storage state.
- Docs conflict: Current API docs mark `credentials` as added in v1.61, while the v1.62.0 release note describes it as new in v1.62. The version attribution differs.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.62.0
- https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state-option-credentials
- https://playwright.dev/docs/auth#reuse-signed-in-state
- https://playwright.dev/docs/api/class-browsercontext#browser-context-set-storage-state
- https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state-option-path
- https://playwright.dev/docs/api/class-browser#browser-new-context-option-storage-state
- https://playwright.dev/docs/api/class-browsercontext#browser-context-set-storage-state-param-storage-state
Check the installed version and the source before using it. Entry JSON