Skip to main content
In this quickstart we will learn how to:
  • Connect to a remote Turso database
  • Execute SQL queries using SQL over HTTP
@tursodatabase/serverless@libsql/clientRaw HTTP
StatusProduction-readyProduction-readyAlways available
DependenciesUses only fetch — zero native dependenciesRequires Node.js or /web subpathNone (any HTTP client)
ORM supportNot yet supportedDrizzle, Prisma, and othersN/A
@tursodatabase/serverless is the lightest option with zero native dependencies. Use @libsql/client if you need a battle-tested driver today with ORM integration.
The @tursodatabase/serverless package connects to Turso using only the fetch API — no native dependencies, making it the smallest option for edge and serverless runtimes.
1

Install

npm install @tursodatabase/serverless
2

Connect and query

import { connect } from "@tursodatabase/serverless";

const conn = connect({
  url: process.env.TURSO_DATABASE_URL,
  authToken: process.env.TURSO_AUTH_TOKEN,
});

const stmt = conn.prepare("SELECT * FROM users WHERE id = ?");
const row = await stmt.get([123]);
For compatibility with the libSQL client API, use the compat module:
import { createClient } from "@tursodatabase/serverless/compat";

const client = createClient({
  url: process.env.TURSO_DATABASE_URL,
  authToken: process.env.TURSO_AUTH_TOKEN,
});

const result = await client.execute("SELECT * FROM users WHERE id = ?", [123]);