Installation & Configuration
The official Node.js SDK for integrating NodeRails crypto payments. Zero runtime dependencies, full TypeScript support, and cross-runtime compatibility.
Installation
Requirements
- Node.js 18+ (uses native
fetch) - Also works in Deno and Bun
- TypeScript 5+ recommended (full type inference)
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
appId | string | Your app UUID from the dashboard | |
apiKey | string | Secret API key (nr_*_sk_*) | |
baseUrl | string | https://api.noderails.com | Override the API base URL |
timeout | number | 30000 | Request timeout in milliseconds |
apiVersion | string | Latest | Pin requests to a specific API version |
Secret keys only
sk). Public keys cannot be used as they are for client-side operations only.Common patterns
Pagination
All list endpoints return a PaginatedResult with data and pagination:
Idempotency keys
For safe retries, pass an idempotency key on any mutating request. If you send the same key twice, you'll get back the same response without creating a duplicate.
Authentication header
The SDK automatically sends your API key using the x-api-key header. Manually, the headers look like:
Response format
API responses use a standard envelope. The SDK unwraps this automatically so you always get the data directly:
TypeScript support
All request parameters and response types are fully typed. Import types directly from the SDK:
Resources
Each resource has its own page with full usage examples, method references, and TypeScript types:
Create hosted checkout pages. Full flow: create → redirect → webhook → status.
Core payment object. Create, authorize, capture, settle, cancel, refund.
Bill customers with line items. Create → open → send → paid.
Recurring payments. Create plans, subscribe customers, pause/resume/cancel.
Manage customers and their wallets.
Shareable payment URLs. No integration needed.
Define products with multiple pricing tiers for subscriptions.
Register endpoints, rotate secrets, verify signatures.
Create and manage tax rates for invoices.
Real-time USD ↔ crypto conversion.