Zum Inhalt springen

Erste Schritte

GitHub
Terminalfenster
bun add @capgo/capacitor-stripe-identity
bunx cap sync
import { StripeIdentity } from '@capgo/capacitor-stripe-identity';
import { StripeIdentity } from '@capgo/capacitor-stripe-identity';
await StripeIdentity.initialize({ publishableKey: 'publishable-key-123' });
import { StripeIdentity } from '@capgo/capacitor-stripe-identity';
await StripeIdentity.create({
verificationId: 'verification-id-123',
ephemeralKeySecret: 'ephemeral-key-secret',
});
import { StripeIdentity } from '@capgo/capacitor-stripe-identity';
await StripeIdentity.present();
  • Listener: Handles beim Unmounten von Screens entfernen.
  • Einmalige Initialisierung: Setup beim App-Bootstrap ausführen.
  • Single Source of Truth: Vertrauen src/definitions.ts im GitHub Repo.

Erstelle eine VerificationSession in deinem Backend und übergib dann die IDs an das Plugin:

await StripeIdentity.initialize({ publishableKey: 'pk_test_...' });
await StripeIdentity.create({
verificationId: 'vs_...',
ephemeralKeySecret: 'ek_...',
clientSecret: 'vs_..._secret_...', // web only
});
await StripeIdentity.present();
Terminalfenster
git clone https://github.com/Cap-go/capacitor-stripe-identity.git
cd capacitor-stripe-identity/example-app
bun install
bun run start

Diese Seite dokumentiert die aktuelle öffentliche API von Cap-go/capacitor-stripe-identity.