@capgo/capacitor-stripe-identity
v8.0.4
Published
Capacitor plugin for Stripe Identity verification.
Downloads
681
Maintainers
Readme
@capgo/capacitor-stripe-identity
Capacitor plugin for Stripe Identity — verify users with document and selfie checks using Stripe's native verification sheet on iOS and Android.
Why this plugin
This plugin is a maintained fork of @capacitor-community/stripe. Capgo split the community project into focused packages — each with its own docs, example app, and CI.
We track open issues and pull requests in the community repository, merge relevant fixes into our repos, and ship them on current Stripe SDKs. Our goal is to be more reactive than the community maintainers when bugs land or platforms change.
This package covers Stripe Identity — document and selfie verification.
If you use the community package today, this is the maintained upgrade path from the community package.
Documentation
The most complete documentation is available here: https://capgo.app/docs/plugins/stripe-identity/
Compatibility
| Plugin version | Capacitor compatibility | Maintained | | -------------- | ----------------------- | ---------- | | v8.. | v8.. | ✅ | | v7.. | v7.. | On demand |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
Install
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-stripe-identity` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
# Install (choose one)
npm install @capgo/capacitor-stripe-identity
pnpm add @capgo/capacitor-stripe-identity
yarn add @capgo/capacitor-stripe-identity
bun add @capgo/capacitor-stripe-identity
# Then sync Capacitor (choose one)
npx cap sync
pnpm exec cap sync
yarn cap sync
bunx cap syncPlatform setup
iOS
Add NSCameraUsageDescription to Info.plist with a string that explains why your app needs camera access for identity verification. See Stripe's iOS camera authorization guide for details.
Android
Set your app theme to a Material Components theme in android/app/src/main/res/values/styles.xml:
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">Any Material Components parent theme works. See Material theming options and Stripe's Android Material theme guide.
Usage
For implementation details, see the Stripe Identity documentation.
import { StripeIdentity, IdentityVerificationSheetEventsEnum } from '@capgo/capacitor-stripe-identity';
const listener = await StripeIdentity.addListener(IdentityVerificationSheetEventsEnum.VerificationResult, (result) => {
console.log(result);
listener.remove();
});
// initialize is needed only for Web Platform
await StripeIdentity.initialize({
publishableKey,
});
await StripeIdentity.create({
ephemeralKeySecret,
verificationId,
// clientSecret is needed only for Web Platform
clientSecret
});
await StripeIdentity.present();API
initialize(...)create(...)present()addListener(IdentityVerificationSheetEventsEnum.Loaded, ...)addListener(IdentityVerificationSheetEventsEnum.FailedToLoad, ...)addListener(IdentityVerificationSheetEventsEnum.VerificationResult, ...)- Interfaces
- Type Aliases
- Enums
initialize(...)
initialize(options: InitializeIdentityVerificationSheetOption) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------- |
| options | InitializeIdentityVerificationSheetOption |
create(...)
create(options: CreateIdentityVerificationSheetOption) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| options | CreateIdentityVerificationSheetOption |
present()
present() => Promise<void>addListener(IdentityVerificationSheetEventsEnum.Loaded, ...)
addListener(eventName: IdentityVerificationSheetEventsEnum.Loaded, listenerFunc: () => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------------------- |
| eventName | IdentityVerificationSheetEventsEnum.Loaded |
| listenerFunc | () => void |
Returns: Promise<PluginListenerHandle>
addListener(IdentityVerificationSheetEventsEnum.FailedToLoad, ...)
addListener(eventName: IdentityVerificationSheetEventsEnum.FailedToLoad, listenerFunc: (info: StripeIdentityError) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| eventName | IdentityVerificationSheetEventsEnum.FailedToLoad |
| listenerFunc | (info: StripeIdentityError) => void |
Returns: Promise<PluginListenerHandle>
addListener(IdentityVerificationSheetEventsEnum.VerificationResult, ...)
addListener(eventName: IdentityVerificationSheetEventsEnum.VerificationResult, listenerFunc: (result: IdentityVerificationResult) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| eventName | IdentityVerificationSheetEventsEnum.VerificationResult |
| listenerFunc | (result: IdentityVerificationResult) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
InitializeIdentityVerificationSheetOption
| Prop | Type |
| -------------------- | ------------------- |
| publishableKey | string |
CreateIdentityVerificationSheetOption
| Prop | Type | Description |
| ------------------------ | ------------------- | ----------------------------------------------------- |
| verificationId | string | |
| ephemeralKeySecret | string | |
| clientSecret | string | This client secret is used only for the web platform. |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
StripeIdentityError
| Prop | Type |
| ------------- | ------------------- |
| code | string |
| message | string |
IdentityVerificationResult
| Prop | Type |
| ------------ | ------------------------------------------------------------------------------------------------------------- |
| result | IdentityVerificationSheetResultInterface |
| error | StripeIdentityError |
Type Aliases
IdentityVerificationSheetResultInterface
IdentityVerificationSheetEventsEnum.Completed | IdentityVerificationSheetEventsEnum.Canceled | IdentityVerificationSheetEventsEnum.Failed
Enums
IdentityVerificationSheetEventsEnum
| Members | Value |
| ------------------------ | ---------------------------------------------------- |
| Loaded | 'identityVerificationSheetLoaded' |
| FailedToLoad | 'identityVerificationSheetFailedToLoad' |
| Completed | 'identityVerificationSheetCompleted' |
| Canceled | 'identityVerificationSheetCanceled' |
| Failed | 'identityVerificationSheetFailed' |
| VerificationResult | 'identityVerificationResult' |
