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

# Quickstart

> From zero to an evaluated flag: define new-checkout, push it, check it in code.

## Overview

Maya is wiring feature flags into Fieldkit's `web-app`. In this guide she creates a boolean toggle called `new-checkout`, syncs it to production, and evaluates it in a Node process.

Time: a few minutes. You need Node.js 20+ and a [shipd account](https://app.useshipd.com).

## 1. Install the CLI

```bash theme={null}
pnpm add -g @shipdit/cli
shipd --help
```

## 2. Log in

```bash theme={null}
shipd login
```

The CLI opens `/auth/device/code`. Pick **organization → project → environment** (Maya picks `fieldkit` → `web-app` → `production`). Approval stores a management API key in `~/.config/shipd/credentials.json`.

```bash theme={null}
shipd whoami
```

<Tip>
  CI does not use `shipd login`. Create a management API key in the dashboard and set `SHIPD_API_KEY`. See [Push flags from CI](/how-to/push-from-ci).
</Tip>

## 3. Define the flag

Create `shipd.config.ts` next to `package.json`:

```ts shipd.config.ts theme={null}
import { defineFlags } from "shipdit/config";

export default defineFlags({
  "new-checkout": {
    type: "boolean",
    default: false,
    description: "Redesigned checkout flow",
    tags: ["checkout"],
  },
});
```

`shipdit` is the SDK package. `defineFlags` lives at `shipdit/config`.

## 4. Push and generate types

```bash theme={null}
shipd push --project web-app --env production --yes
```

`shipd push` diffs local definitions against the server, applies them, then writes `src/generated/flags.ts`.

```text theme={null}
Plan:
  + create flag "new-checkout"

Wrote types for 1 flag(s) to src/generated/flags.ts
```

<Note>
  Creating or updating a **definition** (type, variants, tags, lifecycle) needs production permission even when `--env` is staging. Defaults are per environment. See [Environments](/concepts/environments).
</Note>

## 5. Evaluate it

```bash theme={null}
pnpm add shipdit
```

```ts src/checkout.ts theme={null}
import { createClient } from "shipdit";
import type { FlagDefinitions } from "./generated/flags";

const shipd = createClient<FlagDefinitions>({
  sdkKey: process.env.SHIPD_SDK_KEY!,
  endpoint: "https://edge.useshipd.com",
  defaults: { "new-checkout": false },
});

await shipd.ready();

export function checkoutEnabled(userId: string) {
  return shipd.isEnabled("new-checkout", { userId });
}
```

Create the SDK key in the dashboard (`sdkKey.create`). Server keys look like `shipd_sdk_server_…`. The secret is shown once.

A misspelled key is a TypeScript error:

```ts theme={null}
shipd.isEnabled("new-chekcout");
//              ^^^^^^^^^^^^^^^ not a BooleanFlagKey
```

## Next

<CardGroup cols={2}>
  <Card title="Define more flags" href="/guides/define-flags" icon="file-code">
    Variants, numbers, JSON — still in `shipd.config.ts`.
  </Card>

  <Card title="Evaluate in the browser" href="/guides/evaluate-flags" icon="bolt">
    `shipdit/client`, polling, and WebSocket invalidation.
  </Card>

  <Card title="Target a user" href="/guides/target-users" icon="users">
    `identify`, traits, and `userId`.
  </Card>

  <Card title="React" href="/guides/react" icon="code">
    `ShipdProvider` + `useFlag`.
  </Card>
</CardGroup>
