Installation
Get started with the ZenPays SDK in your project.
Requirements
- JavaScript
- Python
Node.js 18.0 or later, plus npm, yarn, or pnpm
Python 3.8 or later, plus pip
Install the package
- JavaScript
- Python
- npm
- yarn
- pnpm
npm install @zenxdigitalholdings/zenpays
yarn add @zenxdigitalholdings/zenpays
pnpm add @zenxdigitalholdings/zenpays
pip install zenpays
TypeScript Support
- JavaScript
- Python
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')
The Python SDK includes full type hints and works seamlessly with mypy and other type checkers.
from zenpays import ZenPays
from zenpays.types.payment import PaymentIntent
import os
zenpays = ZenPays(api_key=os.environ["ZENPAYS_API_KEY"])
# Full type hints support
intent: PaymentIntent = zenpays.payments.get_payment_intent("pi_xxx")
Browser Support
- JavaScript
- Python
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.
The Python SDK is designed for server-side use and is not compatible with browser environments.
tip
Use the JavaScript SDK for browser-based integrations and the Python SDK for server-side operations.
Next Steps
- Quick Start - Create your first payment
- Configuration - Learn about SDK options
- Authentication - Manage API keys