# Stablecoin payment SDKs for Node.js

The public testnet beta uses test USDC on Base Sepolia and Ethereum Sepolia, and test USDT on TRON Nile. There is no real-money charge.

## Install the SDKs

Use Node.js 22.20 or newer. The server SDK creates payments and quotes. The fulfillment SDK receives signed events and processes them with PostgreSQL.

```
npm install @0to1pay/server-sdk @0to1pay/fulfillment-sdk pg
```

## Discover assets with a test key

Issue a project test key in the dashboard. Keep ZERO_TO_ONE_PAY_API_KEY in the server environment. The API origin is https://api.0to1pay.com and the HTTP paths start with /v1.

```
import { ZeroToOnePayClient } from '@0to1pay/server-sdk';

const apiKey = process.env.ZERO_TO_ONE_PAY_API_KEY;
if (!apiKey) throw new Error('Set ZERO_TO_ONE_PAY_API_KEY');
const client = new ZeroToOnePayClient({
  origin: 'https://api.0to1pay.com', apiKey
});
const assets = await client.call('listChainAssets', {});
```

## From order to access pass

Register single-use merchant recipients, then create a payment and quote. The buyer signs before transferring and again when submitting the transaction hash. Verify the raw signed webhook, persist the command, then grant access in a worker. The Next.js example runs this flow on Base Sepolia.

## Integration resources

- [Accept Base USDC in Next.js and grant an access pass with a webhook](https://0to1pay.com/guides/nextjs-base-usdc)
- [Integration guide (Markdown)](https://0to1pay.com/guides/nextjs-base-usdc.md)
- [Try the 0.01 test USDC demo](https://0to1pay.com/demo/base-usdc)
- [Next.js example source (ZIP)](https://0to1pay.com/examples/nextjs-base-usdc.zip)
- [@0to1pay/server-sdk](https://www.npmjs.com/package/@0to1pay/server-sdk)
- [@0to1pay/fulfillment-sdk](https://www.npmjs.com/package/@0to1pay/fulfillment-sdk)
- [OpenAPI JSON](https://api.0to1pay.com/openapi.json)
- [Find the merchant and project IDs in project settings](https://pay.0to1pay.com/merchant#settings)
- [Test projects and API keys](https://pay.0to1pay.com/merchant)
