🚨 This repository has been moved and will be archived on October 10, 2025
All development has moved to the Supabase JS Monorepo
If you're looking for the README of
postgrest-js
, you can find it at:
https://github.com/supabase/supabase-js/tree/master/packages/core/postgrest-jsThis repository was merged into the main Supabase JS monorepo for better coordination, testing, and releases.
- 📖 For documentation: Visit the new postgrest-js location
- 🐛 For issues: Create them in the supabase-js repository
- 🔧 For contributions: See the Contributing Guide
- 📚 For migration help: Read the Migration Guide
- Uncommitted changes: Manually transport your work to the monorepo (file structure is the same under
packages/core/postgrest-js/
)- Open PRs: Tag a maintainer in your PR and we'll help you migrate it
- Issues: Will be transported to the supabase-js repository
⚠️ This is the old repository. Please use the supabase-js monorepo going forward.
Isomorphic JavaScript client for PostgREST. The goal of this library is to make an "ORM-like" restful interface.
Full documentation can be found here.
Install
npm install @supabase/postgrest-js
Usage
import { PostgrestClient } from '@supabase/postgrest-js'
const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL)
- select(): https://supabase.com/docs/reference/javascript/select
- insert(): https://supabase.com/docs/reference/javascript/insert
- update(): https://supabase.com/docs/reference/javascript/update
- delete(): https://supabase.com/docs/reference/javascript/delete
postgrest-js
uses the cross-fetch
library to make HTTP requests, but an alternative fetch
implementation can be provided as an option. This is most useful in environments where cross-fetch
is not compatible, for instance Cloudflare Workers:
import { PostgrestClient } from '@supabase/postgrest-js'
const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL, {
fetch: (...args) => fetch(...args),
})
This repo is licensed under MIT License.
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.