# Installation

This guide walks you through setting up Starwind Pro so you can start installing blocks in minutes.

## Prerequisites

Before you begin, make sure you have:

- An Astro 5 or newer project
- Node.js 22.12 or newer
- A Starwind Pro license for premium blocks, available from the [pricing page](/pricing/)

> **Info:** Free blocks work without a license. You only need a Pro license for premium
blocks.

## Step 1: Initialize Starwind Pro

Choose the setup path that matches your project. Each path ends at
[Step 2: Get Your License Key](#step-2-get-your-license-key).

### CLI Setup (Recommended)

For a project that does not have Starwind UI V3, run `init --pro` from the project root:

```bash
npx starwind@latest init --pro
```

This initializes Starwind UI V3 and configures Pro authorization.

If Starwind UI V3 is already initialized, add Pro authorization with `setup --pro`:

```bash
pnpm dlx starwind@latest setup --pro
```

Both commands create `.env.local` when it is missing and add it to `.gitignore`. Put your license
key in that file after Step 2.

Free `@starwind-pro/*` blocks work with an ordinary Starwind UI V3 setup.

Once complete, [skip to Step 2](#step-2-get-your-license-key).

### Manual Setup

First complete the [Starwind UI Astro manual setup](https://starwind.dev/docs/frameworks/astro/).
It covers the V3 adapter, Tailwind CSS, path alias, shared stylesheet, and theme initialization.

Then add Pro authorization to your existing `starwind.config.json`:

```json title="starwind.config.json"
{
  "pro": {
    "registry": {
      "headers": {
        "Authorization": "Bearer ${STARWIND_LICENSE_KEY}"
      }
    }
  }
}
```

Keep the other V3 config fields from the base setup. The CLI uses
`https://pro.starwind.dev/r/{name}` as the default Pro registry URL.

Create `.env.local` in the project root:

```bash title=".env.local"
STARWIND_LICENSE_KEY=your_starwind_pro_license_key
```

Replace the example value with the key from Step 2. Add `.env.local` to `.gitignore` before you
install a premium block.

> **Caution:** Keep `.env.local` out of version control. The CLI sends the license key in the
`Authorization` header when it requests a premium block.

## Step 2: Get Your License Key

There are a few ways to retrieve your Starwind Pro license key. Once retrieved, add it to your `.env.local` file.

### Fetch Your License Key Here

If you're signed in with Starwind Pro access, you can fetch your license key directly:

<LicenseKeyLoader />

### From the Account Dashboard

1. Sign in to your account and go to [pro.starwind.dev/account/](/account/)
2. Scroll down to the **"Getting Started with Starwind Pro"** section
3. Click the **"Get License Key"** button
4. Your license key will appear in the code block below

<video
class="aspect-1386/452 h-auto w-full rounded-lg"
width="1386"
height="452"
controls
loading="lazy"
>
<source src={get_license_key} type="video/mp4" />
</video>

### From the Polar Dashboard

1. Go to your account page at [pro.starwind.dev/account/](/account/)
2. Click **"Access Polar Portal"** in the Quick Actions card
3. Find your license key in the Polar customer portal

![Polar portal button](./polar_portal_button.jpg)

> **Tip:** Your license key is tied to your account. Keep it secure and don't share it
publicly.

## Step 3: Install Blocks

You're all set. Browse the [component library](/components/) and install any block with the CLI:

```bash
npx starwind@latest add @starwind-pro/hero-01
```

<video
class="aspect-1190/1090 h-auto w-full rounded-lg"
width="1190"
height="1090"
controls
muted
loading="lazy"
>
<source src={install_component_flow} type="video/mp4" />
</video>

> **Info:** You can find the exact install command on each block's demo page. Click the
copy button and paste it into your terminal.

## Next Steps

- Browse the [component library](/components/) to see all available blocks
- Migrating a V2 project? Read the [V3 Migration guide](/docs/getting-started/migration/)
- Having issues? Check the [Troubleshooting](/docs/getting-started/troubleshooting/) page
- Join [the community](https://discord.gg/hYxyyFHNJb) for support and updates