Skip to content

JavaScript

Installation

This page shows how to install the JavaScript SDK and import it into your project.

First, install the SurrealDB SDK using your preferred package manager:

bun install surrealdb
Note

The SurrealDB SDK for JavaScript is also available in the JSR registry as @surrealdb/surrealdb.

After installing the SDK as a dependency, you can import the SDK into your project. The SDK supports several import options, depending on your setup and environment.

import { Surreal } from 'surrealdb';

After installing the SDK, see the quick start guide to build a simple application with the SDK. You can also learn more about carrying out common tasks with the SDK in the following sections:

Was this page helpful?