Skip to content

Installation

Install

bash
npm install @payre/pay

Setup

ts
import { PayrePay } from '@payre/pay';

const payre = new PayrePay({
  secretKey: process.env.PAYRE_SECRET_KEY,  // pyr_sk_live_xxx
});

The secret key must start with pyr_sk_. Get yours at console.payre.dev -> Developer Settings.

Environment Variables

VariableRequiredDescription
PAYRE_SECRET_KEYYesYour developer secret key (pyr_sk_live_xxx)

Requirements

  • Node.js 18+
  • TypeScript 5+ (optional, types included)

Quick Test

ts
import { PayrePay } from '@payre/pay';

const payre = new PayrePay({
  secretKey: process.env.PAYRE_SECRET_KEY,
});

// Charge a test consumer
const receipt = await payre.charge({
  apiKey: 'pyr_ck_live_test_consumer_key',
  tool: 'my-tool',
  amount: 0.001,
});

console.log('Charge successful:', receipt.chargeId);

Next Steps