# Installation

In this section, you will learn how to install the JavaScript SDK in your project.

In this section, you will learn how to install the JavaScript SDK in your project.

## Install the SDK

First, install the [SurrealDB SDK](https://npmjs.com/package/surrealdb) using your favorite package manager:

**bun**

```bash
bun install surrealdb
```

**npm**

```bash
npm install --save surrealdb
```

**yarn**

```bash
yarn add surrealdb
```

**pnpm**

```bash
pnpm install surrealdb
```

> [!NOTE]
> The SurrealDB SDK for JavaScript is also available in the JSR registry as [`@surrealdb/surrealdb`](https://jsr.io/@surrealdb/surrealdb).

## Import the SDK into your project

After installing the SDK as a dependency, you can import the SDK into your project. Depending on your setup and environment, we supported multiple options.

**ESM**

```ts
import { Surreal } from 'surrealdb';
```

**CommonJS**

```ts
const { Surreal } = require('surrealdb');
```

**Deno**

```ts
//Importing from Deno
import { Surreal } from "https://deno.land/x/surrealdb/mod.ts";

// Import with version 
import { Surreal } from "https://deno.land/x/surrealdb/mod.ts";
```

**CDN**

```ts
import { Surreal } from "https://unpkg.com/surrealdb";
// or
import { Surreal } from "https://cdn.jsdelivr.net/npm/surrealdb";
```

## Next steps

After installing the SDK, check out the quick start guide to build your a simple application with the SDK. You can also learn more about carrying out common tasks with the SDK in the following sections:
- [Getting started](/docs/languages/javascript.md)
- [Connecting to SurrealDB](/docs/reference/javascript/concepts/connecting-to-surrealdb.md)
- [Authentication](/docs/reference/javascript/concepts/authentication.md)
