# Get started with Snowtype
> Install Snowtype, authenticate with your Snowplow account, and initialize your project.
> Source: https://docs.snowplow.io/docs/event-studio/implement-tracking/install-snowtype/
> Documentation index: https://docs.snowplow.io/llms.txt

This page walks you through installing Snowtype and connecting it to your Snowplow account.

To use Snowtype, you'll need:

- [Node.js](https://nodejs.org/en/) version 18 or later
- A Snowplow CDI account

## Install Snowtype

Navigate to your project directory and install Snowtype as a development dependency:

**npm:**

```bash
npm install --save-dev @snowplow/snowtype@latest
```

**Yarn:**

```bash
yarn add --dev @snowplow/snowtype@latest
```

**pnpm:**

```bash
pnpm add --save-dev @snowplow/snowtype@latest
```

***

This adds a local `snowtype` executable to your project. You can run it with `npx`, `yarn`, or `pnpm`:

```bash
npx snowtype --help
```

> **Note:** The examples on this page use `npx`. Replace with `yarn` or `pnpm` if you prefer.

## Authenticate

Snowtype needs to authenticate with Console to read your event specifications and data structures. There are two ways to do it:

- [Log in with your browser](#log-in-with-your-browser): for interactive use, when you run Snowtype yourself in a terminal. This is the default.
- [Use an API key](#use-an-api-key): for non-interactive use, such as CI, where nobody can sign in.

### Log in with your browser

Applies to **Snowtype 0.21.0+**[Latest: 0.21.0](/docs/api-reference/versions/#feature-availability-by-version "The latest Snowtype version is 0.21.0")

Run the `login` command:

```bash
npx snowtype login
```

The command prints a sign-in link and offers to open it in your browser. If you belong to more than one organization, it asks you to select a default one.

After that, Snowtype uses this login when no API key is set.

[Snowplow CLI](/docs/api-reference/snowplow-cli/#configure) shares the same login, so you only need to log in with one of the two tools.

To log out, run:

```bash
npx snowtype logout
```

This also logs Snowplow CLI out. It doesn't affect API keys.

### Use an API key

For non-interactive use, such as CI, use a Console API key. [Create an API key](/docs/account-management/#create-an-api-key) in Console under **Settings** > **Manage organization** > **View and manage API keys**. Snowtype only reads data, so the key needs the **View** permission on tracking plans and data structures, and nothing else.

You need both the **API key** and the **API key ID**.

The recommended approach is to set them as environment variables, either in your shell or in a `.env` file at the root of your project:

**.env file:**

```bash
SNOWPLOW_CONSOLE_API_KEY=your-api-key
SNOWPLOW_CONSOLE_API_KEY_ID=your-api-key-id
```

**Shell variable:**

```bash
export SNOWPLOW_CONSOLE_API_KEY=your-api-key
export SNOWPLOW_CONSOLE_API_KEY_ID=your-api-key-id
```

***

You can also pass the credentials directly as CLI flags (`--apiKey` and `--apiKeyId`), but environment variables are easier to manage and keep credentials out of your command history.

If an API key is set, Snowtype uses it instead of the saved login.

## Initialize your project

Run `snowtype init` to create a configuration file for your project:

```bash
npx snowtype init
```

The command will prompt you for:

- Your **organization ID** from Console
- The **tracker** you want to generate code for, e.g. `@snowplow/browser-tracker`
- The **language** for that tracker, if applicable, e.g. `typescript`
- The **format** (language) you want the configuration file to be in
- The **output path** where Snowtype should write the generated code

To find your organization ID, go to [Console](https://console.snowplowanalytics.com/settings) > **Settings** > **Manage organization**.

Snowtype saves these choices to a `snowtype.config.json` file in your project root. You can edit this file directly later, or pass the values as flags to skip the prompts. See the [configuration reference](/docs/event-studio/implement-tracking/configuration-reference/) for all available options.
