surrealdb/agent-skills/surrealdb-js
Claude Code and agent skill by surrealdb/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Using SurrealDB from JavaScript and TypeScript with the official surrealdb SDK, covering connecting (WebSocket/HTTP and embedded engines), authentication, CRUD, parameterized queries, and live queries. Use when connecting to SurrealDB from Node, Deno, Bun, or the browser, using the surrealdb npm package, or performing CRUD and real-time operations from JS/TS code. Triggers: surrealdb JS, surrealdb.js, new Surreal(), db.query, db.create, db.live, TypeScript SDK, npm i surrealdb.
Install
npx vskill@latest install surrealdb/agent-skills/surrealdb-jsSKILL.md
SurrealDB JavaScript SDK
The official SDK (surrealdb on npm) works in Node.js, Deno, Bun, and the browser. It connects to a remote SurrealDB instance over WebSocket/HTTP, or runs an embedded engine in-process. Target the latest stable surrealdb release; install without pinning (npm i surrealdb) unless the user requires a specific version.
Installation
Connect & select namespace/database
Always connect, then use a namespace + database, then authenticate. Close the connection when finished.
Run a local server with surreal start -u root -p root rocksdb:mydb (or in-memory with surreal start -u root -p root). To run SurrealDB in-process with no server, see references/embedded.md.
Authentication
CRUD
Pass a table as a string ("person") or a RecordId for a specific record. See references/data-types.md for RecordId, Table, Duration, Decimal, and other value classes.
Queries
db.query<T>(sql, vars) runs raw SurrealQL and returns an array with one entry per statement. Always pass user input via bound parameters, never string interpolation.
Other helpers: db.let(name, value) / db.unset(name) set session parameters usable as $name in later queries; db.run(fnName, version, args) invokes a defined function; db.queryRaw() returns the unparsed RPC response (status + timing per statement).
Live queries
Subscribe to real-time changes on a table with db.live(). Requires a WebSocket (or embedded) connection — not HTTP. See references/live-queries.md.
References
- references/data-types.md —
RecordId,Table,
Duration, Decimal, Uuid, geometry, and CBOR mapping.
- references/embedded.md — embedded engines via
@surrealdb/node (RocksDB / SurrealKV / in-memory) and @surrealdb/wasm (in-memory / IndexedDB).
- references/live-queries.md —
live,
subscribeLive, and kill patterns.
Resources
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/surrealdb-js/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/surrealdb/agent-skills/surrealdb-js)