SurrealDB

made easy

A Nuxt module that wraps the official SurrealDB JavaScript SDK, providing auto-imported composables, server utils, and support for remote, in-memory, and local embedded databases.

Terminal
npx nuxi module add nuxt-surrealdb

Integrated concepts and features

    Flexible Configuration

    Configure remote, in-memory, and local embedded SurrealDB connections via nuxt.config.ts or environment variables.

    Auto-imported Composables

    Use useSurreal, useSurrealQuery, useSurrealSelect, and more with SSR-safe useAsyncData wrappers.

    Server Utils

    Auto-imported server utils with session support for per-request isolation in your Nitro event handlers.

    Embedded Engines

    Run SurrealDB directly in-process via @surrealdb/wasm (client) or @surrealdb/node (server) for in-memory and local persistent storage.

    Lifecycle Hooks

    Hook into surrealdb:connecting and surrealdb:connected events to run setup logic like authentication or schema initialization.

    SDK Auto-imports

    SurrealDB SDK classes like RecordId, Table, Uuid, and expression helpers are auto-imported in both app and server contexts.