supabase-client-wasm
WASM/TypeScript bindings for supabase-client-sdk.
Note: This crate is part of the
supabase-client-sdkworkspace. It provides#[wasm_bindgen]bindings for using the SDK from JavaScript/TypeScript. If you're building a Rust application targeting WASM, you can usesupabase-client-sdkdirectly with all features.
Key Features
WasmSupabaseClient— main entry point with CRUD methods (from_select,from_insert,from_update,from_delete)WasmAuthClient— sign up/in, sessions, OAuth, password resetWasmRealtimeClient— WebSocket connect/disconnectWasmStorageClient— bucket listing and retrievalWasmFunctionsClient— edge function invocation- TypeScript declarations auto-generated by
wasm-pack - All values cross the JS boundary as JSON via
serde-wasm-bindgen
Building
# Install wasm-pack if needed
# Build for browser <script type="module">
# Or for bundlers (webpack, vite, etc.)
Usage (JavaScript/TypeScript)
import init, { WasmSupabaseClient } from './pkg/supabase_client_wasm.js';
await init();
const client = new WasmSupabaseClient(
'https://your-project.supabase.co',
'your-anon-key'
);
// Query
const rows = await client.from_select('cities', '*');
console.log('Cities:', rows);
// Auth
const auth = client.auth();
const session = await auth.sign_in_with_password('user@example.com', 'password');
// Edge Functions
const functions = client.functions();
const result = await functions.invoke('hello', { name: 'World' });
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.