Skip to main content

Installation

Install the backend SDK first. Add the React SDK only when you need to render payment fields directly in your frontend.

Node SDK

Requires Node.js >=18.

npm install @accrupay/node

Imports

ESM (default):

import AccruPay, { TRANSACTION_PROVIDER, CURRENCY, COUNTRY_ISO_2 } from '@accrupay/node';

CommonJS:

const { default: AccruPay, TRANSACTION_PROVIDER, CURRENCY, COUNTRY_ISO_2 } = require('@accrupay/node');

Exported symbols

ExportTypeDescription
AccruPayclass (default)SDK client — instantiate once per process
TRANSACTION_PROVIDERenumIdentifies which provider to route a session through
CURRENCYenumISO 4217 currency codes (USD, EUR, …)
COUNTRY_ISO_2enumISO 3166-1 alpha-2 country codes (US, GB, …)
note

TRANSACTION_PROVIDER values correspond to providers configured in your AccruPay merchant account. The enum contains only the providers AccruPay currently supports — your account controls which ones are active.

React SDK

Requires React >=16.8 (hooks). Install as a frontend dependency.

npm install @accrupay/react

Named exports

import {
AccruPay, // Context provider — wraps your checkout
CardNumber, // PCI-scoped card number field
CardExpiry, // Expiry date field
CardCVC, // CVC / CVV field
CardholderName, // Cardholder name field
SubmitButton, // Triggers provider-side payment submission
useAccruPay, // Hook — access session state and errors inside the provider
} from '@accrupay/react';
warning

The React SDK authenticates with merchantPublicId — a public identifier safe for the browser. Never pass your apiSecret to the React SDK or any frontend code.

What to install

You needInstall
Create sessions, verify payments, charge stored methods@accrupay/node
Render payment fields in your checkout UI@accrupay/react
Both (standard full integration)Both packages
Custom UI against the raw APINeither — use the GraphQL API directly