{"id":49087,"library":"react-native-stripe-api","title":"react-native-stripe-api","description":"A small React Native library that provides a client for the Stripe REST API, primarily focused on creating tokens from card details. Version 0.1.0 is the latest and only stable release. It is a lightweight alternative to the official Stripe SDK for React Native, but note that many advertised methods (createCustomer, createCharge, etc.) are marked as deprecated in the README and may not work reliably. The library has a fixed security issue (issue #8) and has minimal maintenance. It requires React Native 0.27.2+ and has not been updated since 2016.","status":"maintenance","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/xcarpentier/react-native-stripe-api","tags":["javascript","react-native","Stripe"],"install":[{"cmd":"npm install react-native-stripe-api","lang":"bash","label":"npm"},{"cmd":"yarn add react-native-stripe-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-native-stripe-api","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for React Native","package":"react","optional":false},{"reason":"peer dependency required to run on mobile","package":"react-native","optional":false},{"reason":"old peer dependency for polyfilling ES6 features","package":"babel-polyfill","optional":true}],"imports":[{"note":"Default export class. The CJS require works but the package does not ship TypeScript types.","wrong":"const Stripe = require('react-native-stripe-api')","symbol":"Stripe","correct":"import Stripe from 'react-native-stripe-api'"},{"note":"If using CommonJS with transpilation, the default export might be under .default. The package uses ES modules.","wrong":"const Stripe = require('react-native-stripe-api')","symbol":"Stripe","correct":"const Stripe = require('react-native-stripe-api').default"},{"note":"Named export does not exist; only a default export named Stripe.","wrong":"import { ReactNativeStripeApi } from 'react-native-stripe-api'","symbol":"ReactNativeStripeApi","correct":"import { default as Stripe } from 'react-native-stripe-api'"}],"quickstart":{"code":"import Stripe from 'react-native-stripe-api';\n\nconst apiKey = process.env.STRIPE_API_KEY ?? '';\nconst client = new Stripe(apiKey);\n\nasync function createToken() {\n  try {\n    const token = await client.createToken('4242424242424242', '12', '25', '123');\n    console.log('Token created:', token);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\ncreateToken();","lang":"javascript","description":"Imports Stripe, instantiates with API key, and creates a token from test card details."},"warnings":[{"fix":"Update to version 0.1.0 or later.","message":"Security issue fixed in 0.1.0 - see GitHub issue #8. Older versions expose API keys or have other vulnerabilities.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Use only createToken. For other Stripe operations, use the official Stripe SDK or a backend proxy.","message":"Methods like createCustomer, createCharge, refundCharge, addCardToCustomer, destroyCardOfCustomer, createSubscription, retrieveSubscription are deprecated and struck through in the README. They may not work as expected.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure React Native version is >=0.27.2 and Android API level >=19.","message":"Requires React Native 0.27.2+ and Android 4.4+ (API level 19). Older versions may not work.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using the official Stripe SDK for React Native or a more modern alternative.","message":"The package has outdated peer dependencies, including babel-polyfill@6.9.1 and react@15.1.0. It may conflict with newer React Native setups.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Migrate to the official Stripe SDK (@stripe/stripe-react-native) or a modern wrapper.","message":"The library is in maintenance mode with no updates since 2016. Many Stripe API changes (e.g., API version upgrades, new endpoints) are not supported.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Wrap calls in try-catch and handle errors manually. For better error handling, use the official Stripe SDK.","message":"The createToken method may not handle Stripe API errors correctly; it returns raw error objects without the typical Stripe Error structure.","severity":"breaking","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.1.0':29 '0.27.2':88 '2016':95 '8':79 'advertis':54 'altern':41 'api':5,19 'card':26 'client':14 'creat':23 'createcharg':57 'createcustom':56 'deprec':62 'detail':27 'etc':58 'fix':75 'focus':21 'issu':77,78 'javascript':96 'latest':32 'librari':10,72 'lightweight':40 'mainten':83 'mani':53 'mark':60 'may':67 'method':55 'minim':82 'nativ':3,9,49,87,99 'note':51 'offici':44 'primarili':20 'provid':12 'react':2,8,48,86,98 'react-nat':97 'react-native-stripe-api':1 'readm':65 'releas':36 'reliabl':70 'requir':85 'rest':18 'sdk':46 'secur':76 'sinc':94 'small':7 'stabl':35 'stripe':4,17,45,100 'token':24 'updat':93 'version':28 'work':69","created_at":"2026-06-07T16:59:59.765588+00:00","updated_at":"2026-06-07T16:59:59.765588+00:00","problems":[{"fix":"npm install react-native-stripe-api --save","cause":"Package not installed or missing node_modules.","error":"Cannot find module 'react-native-stripe-api'"},{"fix":"const Stripe = require('react-native-stripe-api').default;","cause":"Incorrect import when using CommonJS require without .default.","error":"TypeError: _reactNativeStripeApi2.default is not a constructor"},{"fix":"Provide a valid Stripe publishable key to the Stripe constructor.","cause":"Stripe instance created with invalid or missing API key.","error":"undefined is not an object (evaluating 'client.createToken')"},{"fix":"Check network connectivity and ensure the API key is correct. On Android emulator, use 10.0.2.2 for localhost.","cause":"Android emulator/device does not have internet or Stripe server is unreachable.","error":"Network request failed"},{"fix":"Use a valid Stripe publishable key (starts with 'pk_test' or 'pk_live').","cause":"Supplied API key does not start with 'pk_' or 'sk_'.","error":"The Stripe API key format is invalid"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/xcarpentier/react-native-stripe-api#readme","github":"https://github.com/xcarpentier/react-native-stripe-api","docs":null,"changelog":null,"pypi":null,"npm":"react-native-stripe-api","openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}