Sourcemap Explorer
Stack · npm package

@stripe/react-stripe-js

React components for Stripe.js and Stripe Elements

latest 6.8.0· MIT· 102 versions publishedView on npm

About

React components for Stripe.js and Stripe Elements

ReactStripeElements

What detecting @stripe/react-stripe-js tells you about a site

This package is one of the most commercially revealing things you can find in a bundle: it means the site takes payments, and does so through Stripe Elements. Its presence tells you there is a checkout, a subscription flow or a billing page, and that card data is being handled through Stripe's hosted iframes rather than touched directly, which is a strong PCI-compliance signal. Finding it confirms a real monetisation path in the product and usually a fairly considered front-end, since the React wrapper implies the team integrated Stripe properly through provider components rather than dropping in a raw script.

Why the exact @stripe/react-stripe-js version matters

The React wrapper version is paired with a specific generation of Stripe.js and the Elements API; newer majors added support for the Payment Element and embedded checkout, which replaced the older card-specific elements. The exact version tells you which payment UI generation the site uses, and whether it is on the modern unified Payment Element or the legacy individual card fields.

@stripe/react-stripe-js in a real-world stack

When you find @stripe/react-stripe-js in a bundle, it rarely travels alone. @stripe/stripe-js loads the underlying script, and the pair almost always appears together.

Quick facts

Latest version6.8.0
LicenseMIT
AuthorStripe
Homepagestripe.com
Installnpm install @stripe/react-stripe-js
Direct dependencies1
Peer dependenciesreact, react-dom, @stripe/stripe-js

Common pairings

Packages this one expects to find in the same project. Each is also a Sourcemap Explorer detection target.

What @stripe/react-stripe-js pulls in

@stripe/react-stripe-js declares 1 direct dependency — each one also rides into any bundle that ships @stripe/react-stripe-js, so they are detection targets too. Reading them is a quick way to understand the package's real footprint .

prop-types

How Sourcemap Explorer detects @stripe/react-stripe-js

@stripe/react-stripe-js ships as v6.8.0, published 2026-07-15 and carries 1 direct dependency, 3 peer dependencies (react, react-dom, @stripe/stripe-js), 102 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when @stripe/react-stripe-js rides inside a deployed bundle — here is how the detection works.

We catch @stripe/react-stripe-js from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/@stripe/react-stripe-js/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.

  1. 1

    Confirm the site exposes sourcemaps

    In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `@stripe/react-stripe-js` paths live.

  2. 2

    Find the package in the bundle

    Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/@stripe/react-stripe-js/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/@stripe/react-stripe-js/package.json` gives you the exact installed version.

  3. 3

    Read the version directly from package.json

    Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/@stripe/react-stripe-js/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.

Major releases of @stripe/react-stripe-js

When each major version first landed. Major bumps are where breaking changes live, so this timeline is the fastest way to date the @stripe/react-stripe-js version a site actually ships against the ecosystem.

Major
First release
Date
v6
6.0.0
2026-03-26
v5
5.0.0
2025-10-01
v4
4.0.0
2025-09-02
v3
3.0.0
2024-11-19
v2
2.0.0
2023-03-13
v1
1.0.1
2020-02-19

Recent versions

Version
Released
6.8.0
2026-07-15
6.7.0
2026-07-01
6.6.0
2026-06-02
6.5.0
2026-05-29
6.4.0
2026-05-18
6.3.0
2026-04-27
6.2.0
2026-04-14
6.1.0
2026-03-30

@stripe/react-stripe-js README

Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.

React Stripe.js

React components for Stripe.js and Elements.

npm version

Requirements

The minimum supported version of React is v16.8. If you use an older version, upgrade React to use this library. If you prefer not to upgrade your React version, we recommend using legacy react-stripe-elements.

Getting started

Documentation

Minimal example

First, install React Stripe.js and Stripe.js.

npm install @stripe/react-stripe-js @stripe/stripe-js
Using hooks

Building a custom payment form? Use the Checkout Sessions API integration shown below — the recommended approach for most integrations. Create a Checkout Session on your server with ui_mode: 'elements' and pass its clientSecret to CheckoutElementsProvider.

Your server endpoint should create a Checkout Session and return its client secret:

// POST /create-checkout-session
const session = await stripe.checkout.sessions.create({
  ui_mode: 'elements',
  mode: 'payment',
  return_url: 'https://example.com/order/123/complete',
  line_items: [
    {
      price_data: {
        currency: 'usd',
        product_data: {name: 'T-shirt'},
        unit_amount: 1099,
      },
      quantity: 1,
    },
  ],
});

res.json({clientSecret: session.client_secret});

Client:

import React, {useState} from 'react';
import {createRoot} from 'react-dom/client';
import {loadStripe} from '@stripe/stripe-js';
import {
  PaymentElement,
  CheckoutElementsProvider,
  useCheckoutElements,
} from '@stripe/react-stripe-js/checkout';

const CheckoutForm = () => {
  const result = useCheckoutElements();
  const [errorMessage, setErrorMessage] = useState(null);

  const handleSubmit = async (event) => {
    event.preventDefault();

    if (result.type !== 'success') {
      return;
    }

    try {
      await result.checkout.confirm({
        returnUrl: 'https://example.com/order/123/complete',
      });
    } catch (error) {
      setErrorMessage(error.message);
    }
  };

  if (result.type === 'error') {
    return <div>{result.error.message}</div>;
  }

  return (
    <form onSubmit={handleSubmit}>
      <PaymentElement />
      <button type="submit" disabled={result.type !== 'success'}>
        Pay
      </button>
      {errorMessage && <div>{errorMessage}</div>}
    </form>
  );
};

// Use the publishable key for the same account that created the Checkout Session.
const stripePromise = loadStripe('pk_test_...');

const App = () => {
  // Fetch clientSecret from your server when the page loads.
  // e.g. POST /create-checkout-session → { clientSecret }
  const clientSecret = '...';

  return (
    <CheckoutElementsProvider stripe={stripePromise} options={{clientSecret}}>
      <CheckoutForm />
    </CheckoutElementsProvider>
  );
};

createRoot(document.getElementById('root')).render(<App />);
Using PaymentElement directly

For existing integrations or when you need fine-grained control over the PaymentIntents flow, use Elements with PaymentElement:

import React from 'react';
import {createRoot} from 'react-dom/client';
import {loadStripe} from '@stripe/stripe-js';
import {
  PaymentElement,
  Elements,
  ElementsConsumer,
} from '@stripe/react-stripe-js';

class CheckoutForm extends React.Component {
  handleSubmit = async (event) => {
    event.preventDefault();
    const {stripe, elements} = this.props;

    if (elements == null) {
      return;
    }

    // Trigger form validation and wallet collection
    const {error: submitError} = await elements.submit();
    if (submitError) {
      // Show error to your customer
      return;
    }

    // Create the PaymentIntent and obtain clientSecret
    const res = await fetch('/create-intent', {
      method: 'POST',
    });

    const {client_secret: clientSecret} = await res.json();

    const {error} = await stripe.confirmPayment({
      //`Elements` instance that was used to create the Payment Element
      elements,
      clientSecret,
      confirmParams: {
        return_url: 'https://example.com/order/123/complete',
      },
    });

    if (error) {
      // This point will only be reached if there is an immediate error when
      // confirming the payment. Show error to your customer (for example, payment
      // details incomplete)
    } else {
      // Your customer will be redirected to your `return_url`. For some payment
      // methods like iDEAL, your customer will be redirected to an intermediate
      // site first to authorize the payment, then redirected to the `return_url`.
    }
  };

  render() {
    const {stripe} = this.props;
    return (
      <form onSubmit={this.handleSubmit}>
        <PaymentElement />
        <button type="submit" disabled={!stripe}>
          Pay
        </button>
      </form>
    );
  }
}

const InjectedCheckoutForm = () => (
  <ElementsConsumer>
    {({stripe, elements}) => (
      <CheckoutForm stripe={stripe} elements={elements} />
    )}
  </ElementsConsumer>
);

const stripePromise = loadStripe('pk_test_6pRNASCoBOKtIshFeQd4XMUh');

const options = {
  mode: 'payment',
  amount: 1099,
  currency: 'usd',
  // Fully customizable with appearance API.
  appearance: {
    /*...*/
  },
};

const App = () => (
  <Elements stripe={stripePromise} options={options}>
    <InjectedCheckoutForm />
  </Elements>
);

createRoot(document.getElementById('root')).render(<App />);

TypeScript support

React Stripe.js is packaged with TypeScript declarations. Some types are pulled from @stripe/stripe-js—be sure to add @stripe/stripe-js as a dependency to your project for full TypeScript support.

Typings in React Stripe.js follow the same versioning policy as @stripe/stripe-js.

Contributing

This project is maintained by Stripe and does not accept external pull requests. If you have feedback or ideas, please open an issue.

FAQ

What is @stripe/react-stripe-js used for?

React components for Stripe.js and Stripe Elements

How can I tell if a website is using @stripe/react-stripe-js?

Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `@stripe/react-stripe-js` from two complementary signals: `node_modules/@stripe/react-stripe-js/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.

How do I find out which version of @stripe/react-stripe-js a website is running?

Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `@stripe/react-stripe-js/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/@stripe/react-stripe-js/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 6.8.0, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.

What is the latest version of @stripe/react-stripe-js?

6.8.0, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.

Is @stripe/react-stripe-js actively maintained?

Very actively maintained — the last release shipped within the past three months. The last published release was 2026-07-15. Source code: https://github.com/stripe/react-stripe-js.

Where can I read more?

Project homepage: https://stripe.com. Source code: https://github.com/stripe/react-stripe-js. Published on npm: https://www.npmjs.com/package/@stripe/react-stripe-js. Licensed as MIT.

Keep reading on Sourcemap Explorer

Detected by Sourcemap Explorer

When a bundle ships sourcemaps, we read the embedded package.json for @stripe/react-stripe-js and report the precise version (the registry's latest is v6.8.0, published 2026-07-15; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.

Install free on Chrome