Installation
Requires Node.js 18+npm install @dime-technology/dime-js-sdk
Quickstart
import { Client } from '@dime-technology/dime-js-sdk';
const dime = new Client('your-api-token');
const txn = await dime.transactions.chargeCard('YOUR_SID', {
amount: 49.99,
token: 'tok_abc123',
});
console.log(txn.transactionStatus); // "Success"
Configuration
import { Client, Config } from '@dime-technology/dime-js-sdk';
// Simple setup
const dime = new Client('your-api-token');
// Full control
const dime = new Client(new Config({
token: 'your-api-token',
baseUrl: 'https://app.dimepayments.com',
timeout: 30000,
maxRetries: 2,
}));
Available Resources
| Property | Endpoints |
|---|---|
dime.transactions | chargeCard, chargeAch, tokenizeCard, refund, void, show, list |
dime.customers | list, show, create, update, delete |
dime.paymentMethods | list, show, create, update, delete |
dime.merchants | list, show, create, update, getFormLink |
dime.addresses | list, show, create, update, delete |
dime.deposits | list, listWithTransactions, show |
dime.recurringPayments | list, show, create, edit, pause, cancel, activate, delete |
Error Handling
import { DimeException, ValidationException } from '@dime-technology/dime-js-sdk';
try {
await dime.transactions.chargeCard('YOUR_SID', { amount: 0 });
} catch (e) {
if (e instanceof ValidationException) {
console.log(e.getErrors());
}
}

