React SDK Quickstart

This guide shows the recommended embedded integration for React applications using @mintmoney/react.

Before you start

You need:

  • a Mint checkout ID
  • a Mint public key for the frontend
  • a Mint secret key for your backend

Mint customer integrations should use the production API base URL: https://api.getmint.money.

Install the SDK

$npm install @mintmoney/react

Configure the provider

1import { createConfig } from '@mintmoney/react/config';
2import { MintMoneyProvider } from '@mintmoney/react/context';
3import '@mintmoney/react/css/styles.css';
4
5const config = createConfig('pk_live_or_test_xxx', {
6 checkoutId: 'checkout_uuid',
7 apiUrl: 'https://api.getmint.money',
8});

Create payments on your backend

Your backend should call Mint using your secret key and return the Mint payment object to the frontend.

Render checkout

Use the Checkout component inside the provider and hand it a createPayment callback that calls your backend.