The SurrealDB SDK for JavaScript and TypeScript is the primary SDK for interacting with SurrealDB from frontend and server-side applications, systems, and APIs. It is designed to be used in a number of environments, including browser-based applications, server-side applications, and serverless functions. You can use the JavaScript SDK to interact with your SurrealDB database instances, or to run SurrealDB as an embedded database within your JavaScript based application, with functionality for executing queries, managing data, running database functions, authenticating to the database, building user signup and authentication functionality, and subscribing to data changes with live queries.
ImportantThe SDK is available as a NPM and a JSR package, with full support for TypeScript types.
NoteThe SDK works seamlessly with SurrealDB versions
v2.0.0
tov2.1.0
, ensuring compatibility with the latest version.
To contribute to the SDK code, submit an Issue or Pull Request in the surrealdb.js repository. To contribute to this documentation, submit an Issue or Pull Request in the docs.surrealdb.com repository.
You can find example repositories that demonstrate how to integrate SurrealDB in a number of different environments:
A simple note-taking application built with SurrealDB, React, and Vite.
A simple note-taking application built with SurrealDB, SvelteKit, and Vite.
A demo project on how to create a realtime presence web application using SurrealDB Live Queries.
A simple TypeScript starter project using Bun.