Vai al contenuto

Per iniziare

GitHub
Finestra del terminale
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: rimuovi gli handle quando gli schermi vengono smontati.
  • Inizializza una volta: esegui il setup durante il bootstrap dell'app.
  • Fonte di verità: fidati src/definitions.ts nel repo GitHub.

Crea una VerificationSession sul tuo backend, poi passa gli ID al plugin:

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

Questa pagina documenta l'attuale API pubblico di Capgo/capacitor-stripe-identity.