@signaledi/sdk
v0.1.0
Published
Typed TypeScript/JavaScript client for the SignalEDI developer API (parse, validate, exchange EDI).
Maintainers
Readme
@signaledi/sdk
Typed client for the SignalEDI developer API — parse,
validate, and exchange EDI from TypeScript or JavaScript. Zero runtime
dependencies (uses the global fetch).
Install
npm install @signaledi/sdkUsage
import { SignalEDI } from "@signaledi/sdk";
const client = new SignalEDI({ apiKey: process.env.SIGNALEDI_API_KEY! });
// Parse → structured JSON + diagnostics
const parsed = await client.parse(rawEdi);
if (parsed.validation.valid) {
console.log(parsed.json);
}
// Validate only
const { validation } = await client.validate(rawEdi);
// Send an outbound document to a trading partner
const { documentId } = await client.sendOutbound({
partnerId: "ptr_123",
documentTypeCode: "810",
payload: { invoiceNumber: "INV-1001" },
});
// List recent transactions, or fetch one by id
const { transactions } = await client.listTransactions({ limit: 50 });
const { transaction } = await client.getTransaction("txn_abc123");Configuration
apiKey(required) — a workspace key carrying theplatformscope. Mint one in the Developer Console.baseUrl(optional) — defaults tohttps://signaledi.com; all endpoints are served under/api/v1. Override for a custom domain or preview deployment.
The API key must carry the platform scope. Errors throw SignalEDIError
(.status, .code). See the OpenAPI contract at docs/openapi/v1/openapi.yaml.
