> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript

> Learn how to create your first stream using the Livepeer Javascript SDK.

<Steps>
  <Step title="Prerequisites">
    To get the most out of this guide, you’ll need to:

    * [Create an API key](https://livepeer.studio/dashboard/developers/api-keys)
  </Step>

  <Step title="Install the SDK">
    Get the Livepeer Javascript SDK.

    <Tabs>
      <Tab title="npm">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        npm install livepeer
        ```
      </Tab>

      <Tab title="yarn">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        yarn add livepeer
        ```
      </Tab>

      <Tab title="pnpm">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        pnpm install livepeer
        ```
      </Tab>

      <Tab title="bun">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        bun install livepeer
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Initialize the SDK">
    The first step is to initialize the SDK with your Livepeer Studio API key.

    ```js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    import { Livepeer } from "livepeer";

    const livepeer = new Livepeer({
      apiKey: "<api-key>", // Your API key
    });
    ```
  </Step>

  <Step title="Use the SDK">
    Now that you have the SDK installed and initialized, you can use it in your app.
    Let's create a stream.

    ```js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    import { Livepeer } from "livepeer";

    const livepeer = new Livepeer({
      apiKey: "<api-key>",
    });

    const main = async () => {
      const { stream } = await livepeer.stream.create({
        name: "Hello from JS SDK!",
      });
      console.log(stream);
    };

    main();
    ```
  </Step>

  <Step title="Try it yourself">
    <Card title="JavaScript Example" href="https://github.com/livepeer/livepeer-js/tree/main/example" icon="arrow-up-right-from-square">
      See the full example on GitHub.
    </Card>
  </Step>
</Steps>

## Next steps

Checkout Livepeer [API Reference](/api-reference) to learn more about the
Livepeer API and the Javascript SDK.
