@robinpath/supabase
v0.3.0
Published
Supabase REST integration — PostgREST (database), GoTrue (auth, admin), Storage (buckets + signed URLs). Pure fetch, no SDK dependency. Uses the RobinPath credential vault.
Readme
@robinpath/supabase
Supabase module for RobinPath.
Why use this module?
The supabase module lets you:
- Select rows from a table with optional filters, ordering, and pagination
- Insert one or more rows into a table
- Update rows matching filters
- Insert or update rows (merge on conflict)
- Delete rows matching filters
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
robinpath add @robinpath/supabaseQuick Start
1. Set up credentials
supabase.setCredentials "https://xyz.supabase.co" "eyJhbGc..."2. Store a service role key for admin operations (Auth admin, etc.)
supabase.setServiceKey "https://xyz.supabase.co" "eyJhbGc..."Available Functions
| Function | Description |
|----------|-------------|
| supabase.setCredentials | Store Supabase project URL and anon/service API key |
| supabase.setServiceKey | Store a service role key for admin operations (Auth admin, etc.) |
| supabase.select | Select rows from a table with optional filters, ordering, and pagination |
| supabase.insert | Insert one or more rows into a table |
| supabase.update | Update rows matching filters |
| supabase.upsert | Insert or update rows (merge on conflict) |
| supabase.delete | Delete rows matching filters |
| supabase.rpc | Call a Postgres function via RPC |
| supabase.signUp | Sign up a new user with email and password |
| supabase.signIn | Sign in a user with email and password |
| supabase.signInWithOtp | Send a magic link to the user's email for passwordless sign in |
| supabase.signOut | Sign out a user by invalidating their access token |
| supabase.getUser | Get the user object from a JWT access token |
| supabase.updateUser | Update user attributes (email, password, metadata) |
| supabase.listUsers | Admin: List all users (requires service role key) |
| supabase.deleteUser | Admin: Delete a user by ID (requires service role key) |
| supabase.inviteUser | Admin: Invite a user by email (requires service role key) |
| supabase.listBuckets | List all storage buckets |
| supabase.createBucket | Create a new storage bucket |
| supabase.deleteBucket | Delete a storage bucket (must be empty first) |
| supabase.emptyBucket | Remove all files from a storage bucket |
| supabase.listFiles | List files in a storage bucket/folder |
| supabase.uploadFile | Upload a file to a storage bucket |
| supabase.downloadFile | Download a file from a storage bucket |
| supabase.deleteFile | Delete one or more files from a storage bucket |
| supabase.getPublicUrl | Get the public URL for a file in a public bucket |
| supabase.createSignedUrl | Create a signed URL for temporary access to a private file |
Examples
Store a service role key for admin operations (Auth admin, etc.)
supabase.setServiceKey "https://xyz.supabase.co" "eyJhbGc..."Select rows from a table with optional filters, ordering, and pagination
supabase.select "users" "*" {"eq": {"status": "active"}, "limit": 10}Insert one or more rows into a table
supabase.insert "users" {"name": "Alice", "email": "[email protected]"}Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/supabase";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
supabase.setCredentials "https://xyz.supabase.co" "eyJhbGc..."
supabase.setServiceKey "https://xyz.supabase.co" "eyJhbGc..."
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/mysql— MySQL module for complementary functionality@robinpath/postgres— PostgreSQL module for complementary functionality@robinpath/mongo— Mongo module for complementary functionality@robinpath/redis— Redis module for complementary functionality@robinpath/firebase— Firebase module for complementary functionality
License
MIT
