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.

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.

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;
}