Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 494 Bytes

USAGE.md

File metadata and controls

27 lines (22 loc) · 494 Bytes
import { SDK } from "@speakeasyapi/code-samples";
import { openAsBlob } from "node:fs";

const sdk = new SDK({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const result = await sdk.codesamples.preview({
    languages: [
      "<value>",
    ],
    schemaFile: await openAsBlob("example.file"),
  });

  // Handle the result
  console.log(result);
}

run();