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

# SAM Studio Quickstart: Sign In, Create, and Run Code

> Learn how to sign in, create your first project, pair a SAM Labs block, and run your first script in SAM Studio in under 10 minutes.

This guide walks you through everything you need to go from zero to a running SAM Studio project. By the end, you'll have signed in, created a project in one of SAM Studio's three coding environments, connected a block (physical or virtual), and executed your first piece of code.

<Note>
  SAM Studio works best in **Google Chrome** or **Microsoft Edge** on a desktop or laptop. Bluetooth pairing with physical blocks requires Chrome on a device with Bluetooth support. Other modern browsers support virtual blocks and most platform features.
</Note>

<Steps>
  <Step title="Sign in to SAM Studio">
    Open your browser and navigate to [studio.samlabs.com](https://studio.samlabs.com).

    On the sign-in screen you have three options:

    * **Sign in with Google** — click the Google button and authenticate with your school Google account.
    * **Sign in with Microsoft** — click the Microsoft button and authenticate with your school Microsoft account.
    * **Email and password** — enter the email address and password you registered with SAM Labs.

    If your school uses single sign-on (SSO), your IT administrator may provide a direct link that takes you straight to your dashboard after authenticating with your school identity provider.

    Once you're signed in, you land on your **Dashboard**, where your recent projects and assigned lessons appear.
  </Step>

  <Step title="Create a new project">
    From the Dashboard, click **New Project** in the top-right corner.

    A dialog asks you to choose a coding environment:

    | Environment     | Best for                  | How you code                     |
    | --------------- | ------------------------- | -------------------------------- |
    | **SAM Space**   | Grades K–5                | Drag-and-drop visual canvas      |
    | **SAM Blockly** | Grades 4–8                | Snap-together code blocks        |
    | **SAM Script**  | Advanced / older students | JavaScript or Python text editor |

    Select the environment that fits your lesson, give your project a name, and click **Create**. The editor opens immediately in your browser.
  </Step>

  <Step title="Pair your blocks (or use virtual blocks)">
    SAM Studio works with physical SAM Labs Bluetooth blocks **and** on-screen virtual blocks — you don't need hardware to start coding.

    <Tip>
      If you're exploring SAM Studio for the first time or don't have hardware nearby, skip pairing and add a **virtual block** instead. In the editor, open the **Blocks panel**, find any block (for example, LED), and click **Add Virtual Block**. The virtual block behaves exactly like a physical one on screen.
    </Tip>

    **To pair a physical block:**

    1. Make sure Bluetooth is enabled on your device.
    2. Power on your SAM Labs block — the indicator light will flash.
    3. In the SAM Studio editor, open the **Blocks panel** and click **Pair New Block**.
    4. Enter the **Pairing ID** printed on the back of your block, or select your block from the browser's Bluetooth device picker.
    5. A green indicator confirms the block is connected and ready to use.

    Paired blocks appear in your Blocks panel and can be dragged into your project canvas or referenced in code.
  </Step>

  <Step title="Write and run your first code">
    With a block connected, you're ready to bring it to life with code.

    **In SAM Script (JavaScript example):**

    Open the code editor panel. You'll see a blank editor with a default template. Replace it with the following snippet to turn on an LED block and set it to red:

    ```javascript theme={null}
    // Turn on an LED block
    const led = await SAM.connect('led');
    await led.setColor(255, 0, 0);  // Red
    ```

    Click the **Run** button (▶) in the toolbar. If your LED block is paired and connected, it lights up red immediately. If you're using a virtual LED block, you'll see the color change on screen.

    **In SAM Space or SAM Blockly:**

    Drag an LED block onto the canvas, then drag a **Set Color** block and connect it. Press **Play** to execute the flow — no typing required.
  </Step>

  <Step title="Save your project">
    Your work is protected as soon as you create the project:

    * **SAM Space and SAM Blockly** projects save **automatically to the cloud** every time you make a change. You can close the browser tab and pick up exactly where you left off.
    * **SAM Script** projects also save to the cloud, but you can trigger a manual save at any time by clicking the **Save** icon (💾) in the top toolbar or pressing **Ctrl + S** (Windows) / **Cmd + S** (Mac).

    To return to a project later, go to your Dashboard and click the project card. All your blocks, code, and connections are restored.
  </Step>
</Steps>

## What's Next?

You've signed in, created a project, connected a block, and run your first code. Here are good places to go from here:

<CardGroup cols={2}>
  <Card title="Coding Environments" icon="code" href="/environments/sam-space">
    Dive deeper into SAM Space, SAM Blockly, and SAM Script to unlock each environment's full feature set.
  </Card>

  <Card title="Key Concepts" icon="lightbulb" href="/concepts">
    Understand projects, pairing, virtual blocks, and the teacher–student model before building something bigger.
  </Card>

  <Card title="SAM Labs Blocks" icon="microchip" href="/sam-script/blocks-reference">
    See the full catalog of physical blocks — LEDs, motors, buttons, sensors, and more.
  </Card>

  <Card title="Lessons Library" icon="book-open" href="/platform/assigning-lessons">
    Browse 850+ ready-made STEAM lessons you can assign to your class right now.
  </Card>
</CardGroup>
