Skip to main content

Installation

Get started with the ZenPays SDK in your project.

Requirements

Node.js 18.0 or later, plus npm, yarn, or pnpm

Install the package

npm install @zenxdigitalholdings/zenpays

TypeScript Support

The SDK is written in TypeScript and includes complete type definitions out of the box. No additional @types/* package is needed.

import type { PaymentIntent } from '@zenxdigitalholdings/zenpays'
import { ZenPays } from '@zenxdigitalholdings/zenpays'

const zenpays = new ZenPays({
apiKey: process.env.ZENPAYS_API_KEY!,
})

// Full type safety
const intent: PaymentIntent = await zenpays.payments.getPaymentIntent('pi_xxx')

Browser Support

The SDK works in both Node.js and browser environments. For browser usage, you can import directly:

<script type="module">
import { ZenPays } from 'https://unpkg.com/@zenxdigitalholdings/zenpays@latest/dist/index.mjs'

const zenpays = new ZenPays({
apiKey: 'your-publishable-key',
})
</script>
warning

Never expose your secret API key in client-side code. Use publishable keys for browser environments.

Next Steps