libSQL Client (TypeScript)

The TypeScript/JavaScript driver for libSQL and Turso databases

SDK
npm
v0.18.0
577 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
61 /100 Good
Development Activity 44
Maintenance 40
Community 68
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 80
Code Quality 76
Innovation 78
Learning Curve 68

@libsql/client is the official TypeScript/JavaScript driver for libSQL, the open-source fork of SQLite that powers Turso’s distributed database platform. A single createClient({ url }) call gives you a promise-based API (execute, batch, transaction) that works identically whether you’re pointed at a local SQLite file, a remote Turso database over HTTP/WebSocket, or an offline-first “embedded replica” that syncs periodically with a remote primary.

The client automatically selects the right transport based on the connection URL scheme — native SQLite bindings for local files, WebSocket (Hrana protocol) or HTTP for remote databases — so application code stays the same regardless of deployment target. It’s built on the shared @libsql/core package (config parsing, error types, SQL value conversion) alongside sibling packages for WASM (@libsql/client-wasm) and edge/serverless runtimes.

What You Get

  • A unified Client API (execute, batch, transaction) that works the same for local files, remote Turso databases, and in-memory databases
  • Embedded Replicas support — a local SQLite file that periodically syncs with a remote Turso primary via syncUrl/syncInterval, enabling offline reads with eventual sync
  • Encryption-at-rest support for local database files
  • Native integration with Turso’s AI/vector search features for similarity queries directly from SQL
  • Runtime-specific entry points (node.ts, web.ts, plus a companion @libsql/client-wasm package) so the same driver works in Node.js, browsers, and edge runtimes like Vercel/Netlify/Lambda

Common Use Cases

  • Building serverless/edge applications (Vercel, Netlify, Lambda) that need a lightweight SQL database without managing connection pools
  • Multi-tenant SaaS apps that provision one SQLite/Turso database per tenant instead of sharing rows in a single large database
  • Offline-first apps that read/write to a local SQLite file via Embedded Replicas while syncing changes to a remote Turso primary in the background
  • Adding vector similarity search alongside relational data in the same SQLite-compatible database

Under The Hood

Architecture — createClient (packages/libsql-client/src/node.ts) inspects the config’s URL scheme and dispatches to one of three internal client implementations: _createSqlite3Client for local file:/in-memory databases (native SQLite bindings, sqlite3.ts, ~620 lines), _createWsClient for the Hrana WebSocket protocol (ws.ts/hrana.ts, together ~930 lines), or _createHttpClient for HTTP-based remote access (http.ts, ~340 lines) — all three conform to the same Client interface defined in the shared @libsql/core package, so callers never touch transport-specific code directly.

Tech Stack — TypeScript for the driver logic (65% of the repo) with a Rust/native component underneath for local SQLite file access, plus supporting Python tooling (29%) for the monorepo’s test/CI infrastructure. The workspace splits into @libsql/core (shared config/error/value-conversion types), @libsql/client (this package, Node-oriented), and @libsql/client-wasm (browser/edge-oriented, no native bindings).

Code Quality — Core logic is covered by __tests__/ unit tests (uri.test.ts, config.test.ts, client.test.ts) plus a separate smoke_test/ directory with real deployment smoke tests against Vercel and Cloudflare Workers runtimes — a meaningful signal given the package’s explicit goal of working correctly across multiple JS runtimes, not just Node. Release history is thin on GitHub Releases (only one tagged release) despite frequent npm publishes and ~3 commits/month, suggesting versions are cut more informally than via GitHub’s release flow.

API Design — The single createClient(config) entry point with a uniform execute/batch/transaction API across three different transports is a deliberately low-friction design — switching a project from local SQLite to a remote Turso database (or adding Embedded Replicas) is a config change, not a code rewrite. The trade-off is that Config’s scheme-based dispatch (file:, http(s):, ws(s):) is implicit “magic” that developers need to learn from docs rather than the type system alone.

Used by 16 apps in this directory

JavaScript
94%
AGPL 3.0

MyApi

AI Agents

23

A privacy-first personal API gateway for AI agents — connect your services once, issue scoped tokens to agents like OpenClaw, Hermes, or Claude Code, and keep a full audit trail instead of scattering raw credentials across .env files.

View details
37
Repo Health
64
Technical
73
Dependency
Built with
JavaScript 94%
Updated 3 weeks ago
TypeScript
94%
MIT

open-seo

Developer Tools · Marketing

24,707

Pay-as-you-go open source SEO platform with MCP integration — keyword research, rank tracking, backlinks, site audits, and AI brand visibility in one self-hosted tool.

View details
83
Repo Health
79
Technical
74
Dependency
Built with
TypeScript 94%
Updated 1 weeks ago
TypeScript
82%
AGPL 3.0

OpenStatus

Devops · Monitoring

9,221

Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.

View details
77
Repo Health
82
Technical
69
Dependency
Built with
TypeScript 82%
MDX 14%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Papra

Bookmarks Archiving

5,587

Self-hosted document archiving with email ingestion, OCR full-text search, and pluggable storage — store once, find anything.

View details
86
Repo Health
82
Technical
69
Dependency
Built with
TypeScript 94%
Updated 1 weeks ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
98%
MIT

Promptfoo

AI Development

26,358

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
67
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
63%
AGPL 3.0

undb

Databases · No Code Platforms

2,975

Self-hosted no-code database and BaaS that lets you manage structured data visually with multi-database support, formula fields, and auto-generated OpenAPI endpoints.

View details
58
Repo Health
66
Technical
65
Dependency
Built with
TypeScript 63%
Svelte 35%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers