Skip to content

feat(examples): add passkeys example with shared local Supabase setup and launcher - #1407

Merged
spydon merged 14 commits into
mainfrom
examples-passkeys
Jun 16, 2026
Merged

spydon merged 14 commits into
mainfrom
examples-passkeys

Conversation

@spydon

@spydon spydon commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Adds an examples/ directory with a runnable example showing off the passkey (WebAuthn) support, plus shared local Supabase infrastructure and a launcher so the same setup can be reused by future examples.

Based on #1408 (passkey ceremony helpers). Review/merge that first; this PR targets its branch and GitHub will retarget it to main once #1408 merges.

What is the new behavior?

examples/passkeys

A Flutter web app demonstrating passkeys with supabase_flutter:

  • Create an account / sign in with email and password
  • Register a passkey for the signed-in user
  • Sign in with an existing passkey (no password)
  • List, rename and delete passkeys

The full WebAuthn ceremony (including the platform prompt) is handled by supabase_flutter via registerPasskey() and signInWithPasskey() from #1408, so the example just calls those. The web build loads the passkeys plugin's JavaScript bundle in web/index.html. The README explains, concisely, what is needed to use passkeys.

examples/supabase

A single shared config.toml every example runs against. It enables passkeys ([auth.passkey] + [auth.webauthn]), disables email confirmations for quick sign in, and trims the stack to the data plane (turns off Studio, the email-testing server, Edge Functions, and analytics) so supabase start is lean.

examples/launcher

A small Dart TUI (examples/run.sh) that boots the local Supabase stack, reads back the local URL and publishable key, lists the examples and runs the selected one on Chrome with the credentials wired in as --dart-defines. It stops the stack on exit if it started it. New examples (any directory with a pubspec.yaml and lib/main.dart) are discovered automatically.

A root examples/README.md explains the whole workflow.

How was it tested?

  • flutter analyze / dart analyze and dart format clean across the new packages.
  • flutter build web succeeds for the passkeys example.
  • Booted the local stack (Colima) and verified end to end against it: account sign up returns a session, and the passkey registration and authentication options endpoints return valid WebAuthn challenges. The only step not automated is the interactive browser biometric prompt.

Notes

This is a draft for review of the structure before polishing further (e.g. additional examples).

Linear: SDK-1058 (sub-issue of SDK-1057)

@spydon
spydon marked this pull request as ready for review June 16, 2026 09:45
@spydon
spydon requested a review from a team as a code owner June 16, 2026 09:45
@spydon
spydon force-pushed the examples-passkeys branch from 914138c to 5d510b6 Compare June 16, 2026 09:55
@spydon
spydon changed the base branch from main to feat/passkey-ceremony-helpers June 16, 2026 09:55
@spydon
spydon force-pushed the feat/passkey-ceremony-helpers branch from 5c80b7e to 77d3dc6 Compare June 16, 2026 09:59
spydon added 2 commits June 16, 2026 12:06
Add registerPasskey() and signInWithPasskey() on GoTrueClient so
developers no longer have to hand-write the platform WebAuthn ceremony.
The ceremony is driven by the cross-platform passkeys plugin, and a thin
mapper converts gotrue's W3C options into the plugin's request types.
… passkeys

The bundled passkeys plugin requires iOS 16.0 / macOS 13.5 (its
PasskeysPlugin is gated with @available), and Flutter registers it
unconditionally, so the example app fails to build below those
versions. Bump the example deployment targets and document that
consumers must target at least iOS 16.0 / macOS 13.5.
@spydon
spydon force-pushed the feat/passkey-ceremony-helpers branch from 77d3dc6 to b9c92c4 Compare June 16, 2026 10:06
spydon added 12 commits June 16, 2026 12:20
The passkeys plugin pulls device_info_plus transitively via
passkeys_doctor. From 12.4.0 it calls the iOS 26.1 isiOSAppOnVision API
without a compile time guard, breaking the iOS build on Xcode older than
the iOS 26.1 SDK (the current CI runners). Cap it in the example until
the runners ship a new enough Xcode.
The launcher depends on mason_logger, which requires Dart 3.5+, breaking
melos bootstrap on the Flutter 3.19.x CI job (Dart 3.3). It is a standalone
dev tool with no workspace dependencies, so it does not belong in the
bootstrapped workspace.
Drop the hand-written js_interop authenticator and the manual two-step
start/verify flows now that supabase_flutter exposes registerPasskey() and
signInWithPasskey() (#1408). Load the passkeys web bundle in index.html.
@spydon
spydon force-pushed the examples-passkeys branch from 5d510b6 to 8f8d6b6 Compare June 16, 2026 11:30
Base automatically changed from feat/passkey-ceremony-helpers to main June 16, 2026 12:49
@spydon
spydon merged commit 224bcbe into main Jun 16, 2026
35 checks passed
@spydon
spydon deleted the examples-passkeys branch June 16, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants