32 lines
660 B
TypeScript
32 lines
660 B
TypeScript
/*
|
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
*/
|
|
|
|
import dotenv from "dotenv";
|
|
dotenv.config();
|
|
/**
|
|
* Example usage of the @useautumn/sdk SDK
|
|
*
|
|
* To run this example from the examples directory:
|
|
* npm run build && npx tsx customersGetOrCreate.example.ts
|
|
*/
|
|
|
|
import { Autumn } from "@useautumn/sdk";
|
|
|
|
const autumn = new Autumn({
|
|
xApiVersion: "2.1",
|
|
secretKey: process.env["AUTUMN_SECRET_KEY"] ?? "",
|
|
});
|
|
|
|
async function main() {
|
|
const result = await autumn.customers.getOrCreate({
|
|
customerId: "cus_123",
|
|
name: "John Doe",
|
|
email: "john@example.com",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
main().catch(console.error);
|