GoPay SDK
Package:
gopay-sdk on npm —
a TypeScript client for the official GoPay REST
API, built for server-side Node.js services.Highlights
| Auth | OAuth2 client_credentials, automatic refresh, pluggable token cache |
| Types | Strong models, enums, and method signatures across the API |
| Deploy | ESM + CJS, Node 18+, works with your existing HTTP stack |
What you can build
- Payments — create, query, and complete checkout flows
- Refunds — full or partial refunds and refund history
- Recurrence & auth — recurring charges, captures, voids
- Instruments & statements — payment methods per currency, account exports
- Observability — inject
HttpTransport/TokenCachefor tracing and shared caches
Installation
Add
gopay-sdk and point at sandbox or production gateway URLs.Quickstart
Sandbox credentials, client setup, and first
createPayment in a few
steps.Configuration
Timeouts, OAuth scope, language, custom
User-Agent, transport, and
cache.Payments
Create payments, query state, cards, and embed helpers.
Error handling
GoPayApiError vs GoPayConfigError, retries, and logging safely.Best practices
Production patterns: secrets, amounts, idempotency, and resilience.
Requirements
- Node.js
>=18 - TypeScript
>=5(recommended)