new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Supabase · all subjects

ai-tools/setup

22 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

How to get Supabase connection string

To get your connection string, click Connect at the top of any project page in the Supabase dashboard. Copy the URI from the Shared pooler option.

Initialize Supabase local project for vecs

To use vecs with a local Supabase database, first ensure the Supabase CLI is installed. Initialize a project with 'supabase init' and start a local Postgres instance with 'supabase start'. Docker must be running.

Create Expo app with blank TypeScript template

To create a new Expo app with a blank TypeScript template, run: npx create-expo-app my-app --template blank-typescript

Run Expo development server

Start the Expo development server with: npx expo start. Scan the QR code with Expo Go app on your phone, or press 'i' for iOS simulator or 'a' for Android emulator.

JavaScript SDK trace propagation requirements

JavaScript trace propagation requires: @supabase/supabase-js version 2.106.0 or later, @opentelemetry/api available at runtime (either installed directly or as a transitive dependency of the tracing SDK), and a tracing SDK that registers a W3C-compliant propagator with the OpenTelemetry API.

JavaScript SDK tracing subpath import for version 2.112.0+

As of @supabase/supabase-js version 2.112.0, the OpenTelemetry integration lives in an opt-in subpath that must be loaded at the application entry point: import '@supabase/supabase-js/tracing'. The main bundle contains no OpenTelemetry code. The subpath imports @opentelemetry/api directly, so the bundler includes it and module resolution fails loudly if it isn't installed. If tracePropagation is enabled without this import, the SDK logs a one-time warning and sends requests without trace headers.

JavaScript SDK tracing on versions 2.106.0–2.111.x

On @supabase/supabase-js versions 2.106.0–2.111.x, the tracing subpath does not exist and should not be imported. Those versions load @opentelemetry/api dynamically and silently no-op when it is missing.

JavaScript SDK CDN (UMD) build and trace propagation

Trace propagation is not available through the CDN (UMD) build because there is no way to load the tracing runtime there.

OpenTelemetry setup required before SDK trace propagation

The Supabase SDK reads from whatever TracerProvider is registered globally but does not configure one. If the app hasn't been instrumented yet, follow the OpenTelemetry JavaScript getting started guide to install an SDK (@opentelemetry/sdk-trace-node for Node, @opentelemetry/sdk-trace-web for browsers) and an exporter for the backend (OTLP, Jaeger, Zipkin, or a vendor-specific one). The Supabase SDK only propagates the trace context that is already active when a request is made.

Enable JavaScript SDK trace propagation

Trace propagation is opt-in and takes two steps: load the tracing runtime at the entry point (version 2.112.0 and later by importing '@supabase/supabase-js/tracing'), and pass tracePropagation: true when creating the client.

JavaScript SDK trace propagation example

import '@supabase/supabase-js/tracing' import { trace } from '@opentelemetry/api' import { createClient } from '@supabase/supabase-js' const supabase = createClient(SUPABASE_URL, SUPABASE_KEY, { tracePropagation: true, }) const tracer = trace.getTracer('my-app') await tracer.startActiveSpan('fetch-users', async (span) => { // Outgoing request carries the active trace context. const { data, error } = await supabase.from('users').select('*') span.end() })

JavaScript SDK advanced trace propagation configuration

Trace propagation accepts an object instead of true for fine-grained control with the following options: enabled (boolean, default false) - Enable trace propagation; respectSamplingDecision (boolean, default true) - When false, headers are attached even if the upstream trace is not sampled, useful when every Supabase request should be tagged with a trace_id for log correlation.

JavaScript SDK advanced trace propagation example

import '@supabase/supabase-js/tracing' const supabase = createClient(SUPABASE_URL, SUPABASE_KEY, { tracePropagation: { enabled: true, // Default: true. When false, headers are attached even if the // upstream trace is not sampled — useful when you want every // Supabase request tagged with a trace_id for log correlation. respectSamplingDecision: false, }, })

Swift SDK trace propagation requirements

Swift trace propagation requires supabase-swift 2.51.0 or later and swift-tools-version: 6.1 or later (SwiftPM trait support).

Swift SDK OpenTelemetry trait setup

Add the OpenTelemetry trait to the dependency declaration in Package.swift: .package(url: "https://github.com/supabase/supabase-swift.git", from: "2.51.0", traits: ["OpenTelemetry"]). No changes to SupabaseClient are required. After enabling the trait, the active OpenTelemetry span's trace context is automatically injected as a traceparent header on every outgoing request across PostgREST, Storage, Auth, Functions, and Realtime. When there is no active span, the header is not added.

Swift SDK trace propagation example with TracerProvider

import Supabase import OpenTelemetryApi import OpenTelemetrySdk let exporter = /* your OTLP / Jaeger / Zipkin exporter */ let spanProcessor = SimpleSpanProcessor(spanExporter: exporter) let provider = TracerProviderBuilder() .add(spanProcessor: spanProcessor) .build() OpenTelemetry.registerTracerProvider(tracerProvider: provider) let supabase = SupabaseClient( supabaseURL: URL(string: "https://xyzcompany.supabase.co")!, supabaseKey: "your-publishable-key" )

Dart SDK trace propagation requirements

Dart trace propagation requires supabase 2.x or later (Flutter or Dart-only).

Dart SDK trace propagation implementation

Implement a traceContextProvider that returns the current TraceContext from the tracing library. Return null when there is no active span. Pass TracePropagationOptions when creating the client.

Dart SDK trace propagation example

import 'package:supabase/supabase.dart'; final supabase = SupabaseClient( 'https://xyzcompany.supabase.co', 'your-publishable-key', tracePropagationOptions: TracePropagationOptions( enabled: true, traceContextProvider: () { final span = YourTracer.activeSpan; if (span == null) return null; return TraceContext( traceparent: span.traceparent, tracestate: span.tracestate, ); }, ), );

Dart supabase_flutter trace propagation example

await Supabase.initialize( url: 'https://xyzcompany.supabase.co', anonKey: 'your-publishable-key', tracePropagationOptions: TracePropagationOptions( enabled: true, traceContextProvider: () => yourTraceContextProvider(), ), );

Dart SDK trace propagation options table

TracePropagationOptions parameters: enabled (bool, default false) - Enable trace propagation; respectSamplingDecision (bool, default true) - When true, skips propagation if upstream trace is not sampled, set to false to always attach trace_id for log correlation even when traces are not exported; traceContextProvider (TraceContextProvider?, default null) - Callback returning the current TraceContext, return null when there is no active span.

Setup Supabase locally for Edge Functions

Install the latest Supabase CLI, then initialize Supabase in your app root and start the local stack with: supabase init and supabase start.

Give your agent this brain