All blocks

Collaboration

Chat SDK state

The Chat SDK StateAdapter in Postgres for better-supabase/chat-sdk: thread subscriptions, token locks, a TTL cache, capped lists and per-thread queues under a key prefix, plus the bot installations per workspace with a credential_ref instead of the token. Service role only.

DocsModes:managedcustom
terminal
npx better-supabase sql add chat-sdk-state
better-supabase.config.ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  sql: {
    modules: {
      // Modes: "managed", "custom". The default is "managed".
      "chat-sdk-state": { mode: "managed" },
    },
  },
});