Frameworks
Express.js — Scell.io integration
Official TypeScript SDK @scell/sdk v3.5.0
The official `@scell/sdk` v3.5.0 SDK (TypeScript-first, ESM + CJS) integrates with Express.js as middleware or directly in route handlers. Auto-generated strict types, native promise support, built-in exponential retry, automatic idempotency-key on critical POSTs. Compatible with Node.js 20+ (LTS) and Bun.
Key facts
- Install: `npm install @scell/sdk`
- TypeScript-first with auto-generated types
- Singleton client in `app.locals.scell`
- Built-in exponential retry + idempotency
- Compatible with Node.js 20 LTS and Bun
Code example
import express from 'express';
import { ScellClient } from '@scell/sdk';
const app = express();
app.use(express.json());
const scell = new ScellClient({ apiKey: process.env.SCELL_API_KEY! });
app.post('/invoice', async (req, res) => {
const invoice = await scell.invoices.create({
format: 'factur-x',
buyer: { name: req.body.buyerName, is_individual: true },
lines: [{ description: req.body.label, quantity: 1, unit_price: req.body.amount, vat_rate: 20.0 }],
});
res.json({ id: invoice.id });
});
app.listen(3000);