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

# Getting Started

> Create and stop your first Driver browser session.

## Prerequisites

* A Driver account from the [dashboard](https://app.driver.dev)
* A Driver API key

## Use cURL

```bash theme={null}
export DRIVER_API_KEY="dr_..."

curl -X POST "https://api.driver.dev/v1/browser/session" \
  -H "Authorization: Bearer $DRIVER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"hosted"}'
```

The response includes a `sessionId` and `cdpUrl`.

```bash theme={null}
curl -X DELETE "https://api.driver.dev/v1/browser/session?sessionId=$SESSION_ID" \
  -H "Authorization: Bearer $DRIVER_API_KEY"
```

## Use the TypeScript SDK

The current npm package is named `@browsercash/sdk`.

```bash theme={null}
npm install @browsercash/sdk playwright
```

```typescript theme={null}
import { chromium } from "playwright";
import BrowsercashSDK from "@browsercash/sdk";

const client = new BrowsercashSDK({
  apiKey: process.env.DRIVER_API_KEY!,
  baseURL: "https://api.driver.dev",
});

const session = await client.browser.session.create({ type: "hosted" });
const browser = await chromium.connectOverCDP(session.cdpUrl);

const context = browser.contexts()[0] || (await browser.newContext());
const page = context.pages()[0] || (await context.newPage());
await page.goto("https://example.com");
console.log(await page.title());

await browser.close();
await client.browser.session.stop({ sessionId: session.sessionId });
```

## Next Steps

* [Create a Browser Session](/docs/fundamentals/creating-a-browser-session)
* [Use a Browser Session](/docs/fundamentals/using-a-browser-session)
* [Open the API Reference](/api-reference)
