Skip to content

Add sendSignal() helper - #778

Merged
MasterKale merged 21 commits into
milestone/v14.0.0from
feat/browser-send-signal
Aug 5, 2026
Merged

Add sendSignal() helper#778
MasterKale merged 21 commits into
milestone/v14.0.0from
feat/browser-send-signal

Conversation

@MasterKale

@MasterKale MasterKale commented Jul 9, 2026

Copy link
Copy Markdown
Owner

This PR adds a new sendSignal() method to @simplewebauthn/browser to simplify use of the WebAuthn Signal APIs. The WebAuthn Signal APIs are fire-and-forget methods that help Relying Parties (i.e. websites using SimpleWebAuthn for passkeys) try to communicate passkey state changes through the browser and back to an authenticator that may have a passkey for the website. No signal is guaranteed to make it to such an authenticator; WebAuthn Signal API calls (including those made using this new sendSignal() method) are "best effort."

Types for the three possible shapes of options that can be passed into this method are also exported. Types include descriptions of each signal and offer advice on when to use them (https://simplewebauthn.dev will get updated shortly after release with new docs for this method as well):

import {
  sendSignal,
  type SendSignalAllAcceptedCredentialsOpts,
  type SendSignalCurrentUserDetailsOpts,
  type SendSignalUnknownCredentialOpts,
} from '@simplewebauthn/browser';

These same type's are also exported from @simplewebauthn/server to offer RPs typing that can be used when crafting server-side APIs to generate and return these options to pass into sendSignal() in the browser:

import type {
  SendSignalAllAcceptedCredentialsOpts,
  SendSignalCurrentUserDetailsOpts,
  SendSignalUnknownCredentialOpts,
} from '@simplewebauthn/server';

Examples

PublicKeyCredential.signalUnknownCredential()

import {
  sendSignal,
  type SendSignalUnknownCredentialOpts,
} from '@simplewebauthn/browser';

const opts: SendSignalUnknownCredentialOpts = {
  signalName: 'unknownCredential',
  rpID: 'example.com',
  credentialID: 'aPH2yv3TIBVZbj2wJ30Kmw',
};
await sendSignal(opts);

PublicKeyCredential.signalAllAcceptedCredentials()

import {
  sendSignal,
  type SendSignalAllAcceptedCredentialsOpts,
} from '@simplewebauthn/browser';

const opts: SendSignalAllAcceptedCredentialsOpts = {
  signalName: 'allAcceptedCredentials',
  rpID: 'example.com',
  userID: 'Lrk2ki-arSSFcm6PPlMKEQ',
  allAcceptedCredentialIDs: [
    'd77Hxqvltn66l7hegq_E3Q',
    'nz_ajzNrMq3KfPrkOt3lHQ',
  ],
};
await sendSignal(opts);

PublicKeyCredential.signalCurrentUserDetails()

import {
  sendSignal,
  type SendSignalCurrentUserDetailsOpts,
} from '@simplewebauthn/browser';

const opts: SendSignalCurrentUserDetailsOpts = {
  signalName: 'currentUserDetails',
  rpID: 'example.com',
  userID: 'Lrk2ki-arSSFcm6PPlMKEQ',
  userName: 'newUsername@example.com',
  userDisplayName: 'NewUsername (Prod)',
};
await sendSignal(opts);

Fixes #718.

@MasterKale MasterKale added the package:browser @simplewebauthn/browser label Jul 9, 2026
@MasterKale
MasterKale changed the base branch from master to milestone/v14.0.0 July 9, 2026 05:57
@MasterKale MasterKale added the package:server @simplewebauthn/server label Aug 1, 2026
@MasterKale
MasterKale marked this pull request as ready for review August 5, 2026 04:16
@MasterKale MasterKale added this to the v14.0.0 milestone Aug 5, 2026
@MasterKale
MasterKale merged commit baf5488 into milestone/v14.0.0 Aug 5, 2026
15 checks passed
@MasterKale
MasterKale deleted the feat/browser-send-signal branch August 5, 2026 04:20
@MasterKale MasterKale linked an issue Aug 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:browser @simplewebauthn/browser package:server @simplewebauthn/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Passkey Credential Synchronization Signals

1 participant