The Sentry integration for @libsql/client provides tracing, breadcrumbs, and error handling for SQL queries.

This is currently in technical preview. Join us in Discord to report any issues.

Install

npm install sentry-integration-libsql-client

Quickstart

Once you have a @libsql/client instance, you can integrate it with Sentry like this:

import * as Sentry from "@sentry/node";
import { createClient } from "@libsql/client";
import { libsqlIntegration } from "sentry-integration-libsql-client";

const libsqlClient = createClient({
  url: "libsql://...",
  authToken: "...",
});

Sentry.init({
  dsn: "...",
  integrations: [libsqlIntegration(libsqlClient, Sentry)],
});

await libsqlClient.execute("SELECT * FROM users");

Options

By default, everything is turned on. You can configure what you want by passing a third argument to the libsqlIntegration function.

OptionDefaultDescription
tracingtrueEnable tracing for SQL queries.
breadcrumbstrueEnable breadcrumbs for SQL queries.
errorstrueEnable error handling for SQL queries.
Sentry.init({
  dsn: "...",
  integrations: [
    libsqlIntegration(libsqlClient, Sentry, {
      tracing: false,
      breadcrumbs: false,
      errors: false,
    }),
  ],
});