Installation
In this section, you will learn how to install the JavaScript SDK in your project.
Install the SDK
First, install the SurrealDB SDK using your favorite package manager:
npm install --save surrealdb
The SurrealDB SDK for JavaScript is also available in the JSR registry as @surrealdb/surrealdb.
Import the SDK into your project
After installing the SDK as dependency, you can import the SDK into your project. Depending on your setup and environment, we supported multiple options.
import Surreal from 'surrealdb';
const { Surreal } = require('surrealdb');
import Surreal from "https://deno.land/x/surrealdb/mod.ts";
import Surreal from "https://deno.land/x/surrealdb/mod.ts";
import Surreal from "https://unpkg.com/surrealdb";
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: