Langsung ke konten

Panduan Memulai

GitHub
Jendela terminal
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: hapus handle saat screen unmount.
  • Inisialisasi sekali saja: jalankan setup saat app bootstrap.
  • Sumber kebenaran tunggal: percayai src/definitions.ts di repo GitHub.

Buat VerificationSession di backend Anda, lalu kirimkan ID tersebut ke plugin:

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

Halaman ini mendokumentasikan API publik saat ini dari Capgo/capacitor-stripe-identity.