Skip to main content

Installation

Prefer sandbox (gw.sandbox.gopay.com) until you are ready to process real charges — same SDK, different gatewayUrl.

Requirements

  • Node.js >=18
  • A package manager: npm, Yarn, or pnpm
  • GoPay merchant credentials (goid, clientId, clientSecret)

Install from npm

Use the package manager you already use in your app:
npm install gopay-sdk

Choose environment URLs

EnvironmentgatewayUrl
Sandboxhttps://gw.sandbox.gopay.com/api
Productionhttps://gate.gopay.cz/api
The SDK normalizes gatewayUrl (including trailing /api), so values like https://gw.sandbox.gopay.com are accepted.

Verify the dependency

npm ls gopay-sdk
You should see gopay-sdk@… with no extraneous dependency warnings for a clean install.

First import check

import { createGoPayClient } from 'gopay-sdk';

const client = createGoPayClient({
  goid: 8123456789,
  clientId: 'client-id',
  clientSecret: 'client-secret',
  gatewayUrl: 'https://gw.sandbox.gopay.com/api',
});

console.log(typeof client.createPayment); // function

Changelog

Version history ships with every release. After install, open node_modules/gopay-sdk/CHANGELOG.md, or view the published file: CHANGELOG.md.