Skip to content

refactor(supabase_flutter): accept PasskeyAuthenticatorInterface instead of depending on passkeys#1444

Draft
spydon wants to merge 3 commits into
mainfrom
worktree-passkeys-interface-types
Draft

refactor(supabase_flutter): accept PasskeyAuthenticatorInterface instead of depending on passkeys#1444
spydon wants to merge 3 commits into
mainfrom
worktree-passkeys-interface-types

Conversation

@spydon

@spydon spydon commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Draft: blocked on an upstream flutter-passkeys release. Depends on corbado/flutter-passkeys#247. See "Upstream change required" below.

What

Removes the direct dependency on the passkeys plugin. supabase_flutter now depends only on passkeys_platform_interface and the experimental passkey methods accept a PasskeyAuthenticatorInterface:

import 'package:passkeys/authenticator.dart';

final authenticator = PasskeyAuthenticator();

await supabase.auth.signInWithPasskey(authenticator);
await supabase.auth.registerPasskey(authenticator);

Why

supabase_flutter only needs the WebAuthn request/response types and the two ceremony methods. Bundling the full passkeys plugin forced every app, even ones that never touch passkeys, to raise minimum platform versions to iOS 16.0 / macOS 13.5 and pull in transitive deps (passkeys_doctordevice_info_plus). Depending on the platform interface and accepting an authenticator instance removes that.

How

  • pubspec.yaml: passkeyspasskeys_platform_interface.
  • registerPasskey / signInWithPasskey take a PasskeyAuthenticatorInterface. Both are @experimental, so no major version bump.
  • passkey_options_mapper.dart: imports types from passkeys_platform_interface.
  • Removed the now-unnecessary device_info_plus dependency_overrides in the example (verified the example no longer pulls passkeys/device_info_plus when the local package is linked).
  • Updated the README passkeys section.

Upstream change required (blocks this PR)

This depends on corbado/flutter-passkeys#247, which adds PasskeyAuthenticatorInterface to passkeys_platform_interface and makes passkeys's PasskeyAuthenticator implement it. Both changes are non-breaking for those packages (the method signatures already match exactly, so implements only adds a supertype).

Once that PR is merged and published, the version floor here (passkeys_platform_interface: ^2.7.0 is a placeholder) will be pinned to the actual release, and a documented passkeys: >=<version> floor added for consumers.

Verification

  • Verified supabase_flutter compiles and tests pass against a local copy of passkeys_platform_interface carrying the proposed interface (flutter analyze clean, mapper tests pass).
  • CI here will stay red until the upstream passkeys_platform_interface version is published.

…tead of passkeys

Drop the direct dependency on the `passkeys` plugin and depend only on
`passkeys_platform_interface` for the WebAuthn request/response types.

The experimental `registerPasskey` and `signInWithPasskey` methods now take
the ceremony callback as a parameter, so consumers supply their own
authenticator (for example `PasskeyAuthenticator.register` / `.authenticate`
from the `passkeys` plugin). Apps that do not use passkeys are no longer
forced to raise their minimum platform versions or pull in the plugin's
transitive dependencies.
@spydon spydon requested a review from a team as a code owner June 22, 2026 07:51
@Vinzent03

Copy link
Copy Markdown
Collaborator

Would it be possible to just pass the authenticator without the specific method to the signInWithPasskey method? Such that the method in the flutter sdk calls the authenticate or register method on the passed authenticator?

@spydon

spydon commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Would it be possible to just pass the authenticator without the specific method to the signInWithPasskey method? Such that the method in the flutter sdk calls the authenticate or register method on the passed authenticator?

That was my first idea too, but unfortunately not, since PasskeyAuthenticator lives in the passkeys package and not in the interface package. The interface package only exposes the PasskeysPlatform class and if the user has to pass that one we'd lose a lot of error handling etc.

@spydon spydon marked this pull request as draft June 22, 2026 14:54
Switch the experimental passkey methods to accept a
`PasskeyAuthenticatorInterface` from `passkeys_platform_interface` instead of
register/authenticate callbacks, so consumers can pass an authenticator
instance directly.

Requires an upstream release of `passkeys_platform_interface` that defines the
interface and of `passkeys` whose `PasskeyAuthenticator` implements it. The
version floor is a placeholder until those are published.
@spydon spydon changed the title refactor(supabase_flutter): depend on passkeys_platform_interface instead of passkeys refactor(supabase_flutter): accept PasskeyAuthenticatorInterface instead of depending on passkeys Jun 22, 2026
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.

3 participants