Skip to content

Installation

Terminal window
npm install stablezact-pay

The package ships a React build and a standalone browser build. Both talk to the same API.

import { StablezactPayment, PaymentAPI } from 'stablezact-pay';
import 'stablezact-pay/dist/style.css';

The stylesheet is required. Without it the checkout renders unstyled.

Install the latest release (npm install stablezact-pay@latest). Version 0.75.0 and later require a server-created checkout reference: a checkout opened without one shows “Checkout unavailable”.

The checkout touches window on mount, so it cannot be server-rendered. Import it dynamically:

import dynamic from 'next/dynamic';
const StablezactPayment = dynamic(
() => import('stablezact-pay').then((mod) => mod.StablezactPayment),
{ ssr: false }
);
// PaymentAPI has no browser dependency and imports normally.
import { PaymentAPI } from 'stablezact-pay';
import 'stablezact-pay/dist/style.css';

Load the standalone build and use StablezactVanilla. It has no framework dependency and attaches itself to the page. Like the React component, it opens a checkout by reference; see the Quickstart.

The package ships its own types. If your setup does not pick them up, declare the module:

declare module 'stablezact-pay' {
export const StablezactPayment: any;
export const PaymentAPI: any;
}