getlago / lago-javascript-client

Lago Javascript Client
MIT License
21 stars 2 forks source link

feat: generate SDK from Swagger #1

Closed arjunyel closed 1 year ago

arjunyel commented 1 year ago

Using Deno's dnt build system, the SDK is now a Deno project that generates a cross-platform NPM distribution.

There are breaking changes:

import { Client, getLagoError } from 'lago-javascript-client';

const lagoClient = Client('__YOUR_API_KEY__');

try {
    const { data } = await lagoClient.billableMetrics.createBillableMetric(billableMetric);
} catch (error) {
    const lagoError = await getLagoError<typeof lagoClient.billableMetrics.createBillableMetric>(error);
}

Closes https://github.com/getlago/lago-nodejs-client/issues/47