Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 634 Bytes

USAGE.md

File metadata and controls

28 lines (23 loc) · 634 Bytes
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";

const speakeasyCodeSamples = new SpeakeasyCodeSamples({
  apiKey: "<YOUR_API_KEY_HERE>",
  registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
});

async function run() {
  const result = await speakeasyCodeSamples.codeSamples.get({
    registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
    operationIds: [
      "getPetById",
    ],
    languages: [
      "python",
    ],
  });

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

run();