Skip to main content

Function Signature

Future<void> configurePasskeyStorage({
  required String relyingPartyId,
  required List<String> relyingPartyOrigins,
  String? webAuthnHost,
})

Description

Configures Passkey (WebAuthn) backup storage. This must be called before using passkeys for backup or recovery operations.

Parameters

ParameterTypeRequiredDescription
relyingPartyIdStringYesThe relying party identifier (domain)
relyingPartyOriginsList<String>YesList of allowed origins
webAuthnHostStringNoOptional WebAuthn host URL

Returns

void

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

// Configure passkey with Portal's relying party
await portal.configurePasskeyStorage(
  relyingPartyId: 'portalhq.io',
  relyingPartyOrigins: ['https://portalhq.io'],
);

// Now you can use passkey backup
final response = await portal.backupWallet(
  method: PortalBackupMethod.passkey,
);

Using Your Own Domain

await portal.configurePasskeyStorage(
  relyingPartyId: 'your-domain.com',
  relyingPartyOrigins: ['https://your-domain.com'],
  webAuthnHost: 'https://webauthn.your-domain.com',
);

Setup Requirements

Using Portal’s Relying Party (portalhq.io)

  1. Add portalhq.io as a web credential domain in your app
  2. Share your app bundle ID with the Portal team

Using Your Own Domain

  1. Set up associated domains in your app
  2. Serve an AASA file from your domain with webcredential configured
  3. Configure the relying party ID to match your domain
See Apple’s documentation:

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized
CONFIGURATION_FAILEDFailed to configure passkey storage