Usage
Parameters
Supabase project URL. Falls back to
SUPABASE_URL.Supabase API key. Falls back to
SUPABASE_KEY or SUPABASE_SERVICE_ROLE_KEY.Environment variables
Use
SUPABASE_SERVICE_ROLE_KEY for server deployments where you need to bypass Row Level Security. Use SUPABASE_KEY (anon key) for client-side or restricted access.Tables created automatically
LangChat creates these tables on first run:chat_history
| Column | Type | Description |
|---|---|---|
id | bigint | Primary key (auto-increment) |
user_id | text | User identifier |
platform | text | Platform namespace |
message | text | User message |
response | text | AI response |
created_at | timestamptz | UTC timestamp |
request_metrics
| Column | Type | Description | |
|---|---|---|---|
id | bigint | Primary key (auto-increment) | |
user_id | text | User identifier | |
request_time | text | ISO 8601 UTC timestamp | |
response_time | float | Latency in seconds | |
success | boolean | Whether the request succeeded | |
error_message | `text | null` | Error details on failure |
Querying your data
You can use the Supabase dashboard or the Python client directly to query these tables:Row Level Security (RLS)
If you enable RLS on Supabase tables, you must either:- Use the
service_rolekey (bypasses RLS entirely) - Add appropriate RLS policies for the
langchatoperations
SUPABASE_SERVICE_ROLE_KEY is the simplest approach.