Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 956 Bytes

USAGE.md

File metadata and controls

53 lines (42 loc) · 956 Bytes
import { BarSDK } from "@speakeasy-sdks/speakeasy-bar";

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

async function run() {
  const result = await barSDK.drinks.listDrinks();

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

run();
import { BarSDK } from "@speakeasy-sdks/speakeasy-bar";
import { OrderType } from "@speakeasy-sdks/speakeasy-bar/sdk/models/shared";

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

async function run() {
  const result = await barSDK.orders.createOrder([
    {
      productCode: "APM-1F2D3",
      quantity: 567805,
      type: OrderType.Ingredient,
    },
    {
      productCode: "AC-A2DF3",
      quantity: 618237,
      type: OrderType.Ingredient,
    },
  ]);

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

run();