@logtura/supabase-shared
v0.2.11
Published
Shared Supabase Management API plumbing used by the supabase-* logtura drivers.
Readme
@logtura/supabase-shared
Shared helpers for Supabase-* logtura provider drivers. Handles Personal Access Token auth against the Management API, the Bearer ... fetch helper, project listing for verifyCredentials, and the runtime env-var spec.
Today only @logtura/driver-supabase-edge-logs consumes this. When a second Supabase surface lands (postgres logs, auth logs, or storage logs all hang off the same PAT), the shared bits stay here and the driver-side surface stays slim.
npm install @logtura/supabase-shared @logtura/coreWhat's exported
sbFetch<T>(path, pat, init?)returningT. JSON-aware fetch againstapi.supabase.com. ThrowsProviderErroron non-2xx with the Management API's error message.listSupabaseProjects(pat)returningSupabaseProject[]. Lists every project the PAT can see. Used byverifyCredentials.verifySupabaseCredentials(creds)returningProviderAccount[]. Drivers wire this asProviderDriver.verifyCredentials. Returns each project'srefas the account id.sbRuntimeSpec({ helpUrl, extraEnvVars? })returning{ envVars, dockerfileDeps }. DeclaresSUPABASE_PAT(credential) andSUPABASE_PROJECT_REF(external_account_id).safeKey(s). Vector-component-name sanitizer.
