This article is day 1 of #JP_Stripes Advent Calendar.
Hi, I'm Sakakibara. I develop @capacitor-community/stripe, a plugin that uses Stripe on Capacitor—the library that turns web apps into native apps (more precisely, apps built with WebView). For a short history, see this article.
https://zenn.dev/rdlabo/articles/5dec0bec70eab7
Stripe evolves fast! Service evolution usually means "more convenient" and "more features," and Stripe is unmatched in speed. One day you notice checkout can collect a shipping address— handy— and the next, "payment services need account-owner verification to prevent abuse → you need identity checks → we shipped Identity as its own service." That multi-layer evolution is fun to follow.
The plugin evolved with Stripe, so here I look back at that journey.
Stripe plugin evolution in 2021
The predecessor of @capacitor-community/stripe is cordova-plugin-stripe, maintained by ihadeed since 2016 (now not actively maintained). He created @capacitor-community/stripe when Capacitor appeared, and I took over maintenance— so Stripe has been usable on hybrid app platforms for nearly ten years. Long!
Stripe's API changed a lot in that time, and the plugin changed with it.
Security evolution is the clearest example. Card data must not be stored, processed, or passed through the app, and the plugin added features for that model. Those features shifted as Stripe's API changed, so the plugin API changed too. Code like the following is unthinkable today.
cordova.plugins.stripe.createCardToken({
number: '4242424242424242', // 16-digit credit card number
expMonth: 12, // expiry month
expYear: 2020, // expiry year
cvc: '220', // CVC / CCV
}, () => { /* success */ }, () => { /* failed */ });
Over time, clientSecret also stopped living on user devices. In the old days on iOS, hiding the secret key with something like cocoapods-keys (obfuscation) was enough—but today you generate tokens with clientSecret on the server and send them to the device; you never hand clientSecret to the client.
When I took over the repo, security was the first priority. I rebuilt everything. Different era, different foundation— a full rebuild. From the commit log, the main work was:
- Non-storage of card data
- Server-side generation of
clientSecret
I also built a demo app. Maintaining several Capacitor plugins taught me that on hybrid platforms, when web, iOS, and Android all support a method, return values must match (unsupported is fine—but supported methods must align). Without formal requirements, gaps appear: iOS returns Promise<void> while Android returns Promise<value: string>, and so on. I built a demo app and verified behavior on each platform. One tap runs the needed flow— semi-automated testing.
※ Running WebView in Swift or Android instrumented tests is soul-crushing, so I only went as far as semi-automation.
https://twitter.com/rdlabo/status/1693572236467421456
Something like that.
My taking over as maintainer and these major updates were the biggest changes in 2021.
Stripe plugin evolution in 2022
First, I properly organized documentation. As a Japanese maintainer, there is a Japanese site too.
https://stripe.capacitorjs.jp/
https://ja.stripe.capacitorjs.jp/
As you extend the Stripe plugin, you notice how large the API surface is— for example, you can pass stripeAccount for Stripe Connect at initialize time. README on GitHub used to be enough, but issues were mostly basic questions and I often forgot details myself, so I consolidated everything. A nice Capacitor plugin feature: define TypeScript types with summary comments and generate docs via docgen. All documentation types are auto-generated that way.
Otherwise I kept bumping library versions. In July 2022 I added card capture support.
https://twitter.com/rdlabo/status/1549303177618812928
The plugin never covers every Stripe API, so I also merged pull requests that added features bit by bit— for example, collecting user contact and address with Apple Pay.
https://twitter.com/rdlabo/status/1585532646859358209
Capacitor also had a major v3→v4 update, and 2022 included that work.
Stripe plugin evolution in 2023
This year I looked beyond Stripe Payments to adjacent services— specifically Identity (identity verification) and Terminal (in-person payments) (both still unavailable in Japan).
Stripe Identity
https://gyazo.com/ab4099e1ba8e14c62978ea17cf58a887
Identity verifies users by combining ID documents (driver's license, passport) with a selfie. Completion is reported asynchronously via webhooks; the plugin only covers the client-side verification flow. When I tried it, verification usually finished in under a minute even though docs say one to three minutes— impressive. I also saw rejected selfies that even I could not tell were the same person— accuracy is strong (bad photos get rejected; sloppy but same-person shots often pass— really impressive).
https://twitter.com/rdlabo/status/1693572236467421456
You can tie records to customerId, which helps with credit management for invoicing too.
Stripe Terminal
https://realsound.jp/tech/2022/02/post-972084.html
Terminal is for in-person payments. The easiest path is Tap to Pay on a phone without dedicated hardware. Stripe also sells dedicated devices for POS use.
https://stripe.com/ja-gb/terminal#devices
Both are not available in Japan yet, but they point toward Stripe as a customer-data platform centered on customerId, not just payments. Exciting ahead!
Then splitting the plugin
After adding Identity and Terminal to @capacitor-community/stripe, one thing became obvious: it is heavy. Tree shaking is normal on the web, but on iOS (CocoaPods) and Android (Maven), bundled libraries stay in the app even if unused. Installing "payments only" would still pull identity libraries— too heavy. As a web developer, that bothers me a lot— probably a cultural difference.
So I split the plugin. From v5.1.0 released August 25:
- @capacitor-community/stripe
- @capacitor-community/stripe-terminal
- @capacitor-community/stripe-identity
You can install only what you need. Going forward, genuinely different features will get new plugins.
Summary
I sketched the journey of @capacitor-community/stripe. More than the plugin itself, it feels like chasing Stripe's evolution. Stripe is becoming a user-data platform beyond payments, and I want to keep following that path.
See you next time.