import { Streams } from "@clutchcall/sdk/streams";
const streams = new Streams({
baseUrl: "https://app.clutchcall.dev",
apiKey: process.env.CLUTCHCALL_API_KEY!,
orgId: "org_abc",
});
const { input, streamKey } = await streams.liveInputs.create({
name: "My First Stream",
});
// streamKey is returned ONCE — store it; the control-plane API only keeps the hash.
console.log({ inputId: input.external_input_id, streamKey });
// Mint a 1-hour signed playback URL to hand to the browser.
const { url } = await streams.liveInputs
.get({ id: input.external_input_id })
.then(i => i.signedPlaybackUrl({ ttlSeconds: 3600 }));
console.log("playback URL:", url);