# Quickstart

> Install the SDK, call init once, and see your first event. Five minutes, no cookie banner.

Source: https://shipabase.dev/docs/quickstart

## 1. Install the SDK

`Terminal`

```bash
npm i @shipabase/js
```

Zero dependencies, about 2 KB gzipped. Works with npm, pnpm, yarn and bun.

## 2. Add your app key

`.env.local`

```bash
NEXT_PUBLIC_SHIPABASE_KEY=SB-EU-xxxxxxxxxx
```

Find it in the dashboard, on your app’s **Setup** page. It looks like `SB-EU-` followed by 10 lowercase letters or digits.

## 3. Call init once, on the client

**Next.js**

`app/providers.tsx`

```tsx
"use client";

import { useEffect } from "react";
import { init } from "@shipabase/js";

export function Providers({ children }: { children: React.ReactNode }) {
  useEffect(() => {
    init(process.env.NEXT_PUBLIC_SHIPABASE_KEY!, { appVersion: "1.0.0" });
  }, []);
  return <>{children}</>;
}
```

Then wrap `{children}` in `app/layout.tsx` with `<Providers>`. Never call `init` in a Server Component.

**React (Vite)**

`src/main.tsx`

```tsx
import { init } from "@shipabase/js";

init(import.meta.env.VITE_SHIPABASE_KEY, { appVersion: import.meta.env.VITE_APP_VERSION });
```

**Vue / Svelte**

`src/main.ts`

```ts
import { init } from "@shipabase/js";

init(import.meta.env.VITE_SHIPABASE_KEY, { appVersion: import.meta.env.VITE_APP_VERSION });
```

**Node.js**

`server.ts`

```ts
import { init, trackEvent, flush } from "@shipabase/js/node";

init(process.env.SHIPABASE_KEY!, { appVersion: "2.3.0" });

trackEvent("report_generated", { pages: 12, format: "pdf" });

// Short-lived process? Flush before exit.
await flush();
```

## 4. Track what matters

`any client component`

```tsx
import { trackEvent } from "@shipabase/js";

trackEvent("project_created", { plan: "pro" });
```

> Name events in `snake_case`, `object_verb`, past tense. Page views are already tracked automatically: no need to add them. See [Page views](https://shipabase.dev/docs/page-views).

## 5. Check your first event

Trigger the action locally, then open your app’s **Setup** page in the dashboard: it shows the first event as soon as it arrives. Local events are flagged `isDebug`.

> Nothing shows up? See [Verify your setup](https://shipabase.dev/docs/verify).
