Thank you for your interest in contributing to the Supabase JavaScript SDK! This guide will help you get started with contributing to the Supabase JS monorepo.
Repository Structure Changed: This repository has been restructured as a monorepo. All libraries, including
supabase-js, are now underpackages/core/. If you previously contributed tosupabase-js,auth-js,postgrest-js,realtime-js,storage-js, orfunctions-js, please read our Migration Guide to understand:
- Where your code moved (everything is now in
packages/core/<library-name>/)- How commands changed (
npm test→npx nx test <library-name>)- New workflow with Nx
- Getting Started
- Development Workflow
- Commit Guidelines
- Pull Request Process
- Testing
- Documentation
- Release Process
- Getting Help
- Node.js (version 20 or higher)
- npm (comes with Node.js)
- Docker (required for integration tests)
- Git
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone git@github.com:YOUR_USERNAME/supabase-js.git cd supabase-js -
Install dependencies:
npm install
-
Build all packages:
npx nx run-many --target=build --all
-
Run tests to ensure everything works:
npx nx affected --target=test
-
Create a new branch from
master:git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes in the appropriate library under
packages/core/ -
Follow our coding standards:
- Use TypeScript for all new code
- Follow existing code style and patterns
- Add JSDoc comments for public APIs
- Use meaningful commit messages (see Commit Guidelines)
-
Test your changes:
# Run affected tests npx nx affected --target=test # Run specific library tests npx nx test <package-name>
For detailed testing instructions, see TESTING.md and the README in each package directory.
-
Format your code:
npx nx format
-
Build affected packages:
npx nx affected --target=build
We use Conventional Commits with automated tooling to ensure consistent commit messages and enable automatic versioning.
You can use the interactive commit tool instead of git commit directly:
npm run commitThis command will:
- Guide you through creating a properly formatted commit message
- Validate your commit against our rules
- Ensure all required fields are filled out correctly
- Prevent invalid commits from being created
All commits must follow this format:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that do not affect the meaning of the code |
refactor |
A code change that neither fixes a bug nor adds a feature |
perf |
A code change that improves performance |
test |
Adding missing tests or correcting existing tests |
build |
Changes that affect the build system or external dependencies |
ci |
Changes to our CI configuration files and scripts |
chore |
Other changes that don't modify src or test files |
revert |
Reverts a previous commit |
auth- Changes to@supabase/auth-jsfunctions- Changes to@supabase/functions-jspostgrest- Changes to@supabase/postgrest-jsrealtime- Changes to@supabase/realtime-jsstorage- Changes to@supabase/storage-jssupabase- Changes to@supabase/supabase-js
repo- Repository-level changesdeps- Dependenciesci- Changes to CIrelease- Release processdocs- Documentationscripts- Build/dev scriptsmisc- Miscellaneous
feat(auth): add support for custom auth providers
fix(storage): resolve upload timeout issue
docs(postgrest): update filter documentation
chore(deps): update nx to latest version
ci(release): add preview package generation- Scope is required - Every commit must have a scope
- Use imperative mood - "add feature" not "added feature"
- Keep subject line under 100 characters
- No period at the end of the subject line
- Use the interactive tool -
npm run commitensures compliance
-
Ensure your branch is up to date with
master:git checkout master git pull upstream master git checkout your-branch git rebase master
-
Run the full test suite:
npx nx affected --target=test
-
Build all affected packages:
npx nx affected --target=build
-
Push your branch to your fork:
git push origin your-branch-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what was changed and why
- Reference any related issues
- Screenshots or examples if applicable
All pull requests must meet these requirements:
- ✅ At least 1 approving review from a code owner
- ✅ All status checks passing (CI/CD pipeline)
- ✅ No merge conflicts with the base branch
- ✅ Squash merge only (enforced by repository settings)
- Automated checks will run (linting, testing, building)
- Code owners will be automatically requested for review
- Address feedback by pushing new commits to your branch
- Resolve all conversations before merge
Each package has its own testing requirements and infrastructure. For comprehensive testing information, see:
- TESTING.md - Overview of testing across all packages
- Package-specific guides - Detailed testing instructions in each package's README:
# Run tests for a specific package
npx nx test <package-name>
# Run affected tests only (recommended during development)
npx nx affected --target=test
# Run tests with coverage
npx nx test <package> --coverage| Package | Docker Required | Details |
|---|---|---|
| auth-js | ✅ Yes | See README |
| functions-js | ✅ Yes | See README |
| postgrest-js | ✅ Yes | See README |
| realtime-js | ❌ No | See README |
| storage-js | ✅ Yes | See README |
| supabase-js | ❌ No* | See README |
*supabase-js integration tests require additional setup
We automatically generate TypeScript API documentation that is used by the main Supabase documentation site. The process works as follows:
- TypeDoc generates JSON specifications from TypeScript source code
- GitHub Actions publishes these specs to GitHub Pages on every push to
master - Main Supabase repository uses these JSON files to generate the official API docs via
makecommands
# Generate JSON specs for all libraries (used by main docs)
npx nx run-many --target=docs:json --all
# Generate HTML docs for all libraries (for local viewing)
npx nx run-many --target=docs --all
# Generate docs for a specific library
npx nx docs:json auth-js
npx nx docs postgrest-jsWhen contributing changes that affect public APIs, the documentation will be automatically updated when your PR is merged.
All packages in this monorepo use fixed version mode, meaning they share the same version number and are released together. This ensures compatibility and simplifies dependency management.
If you need to test your changes with a release build, you can use pkg.pr.new:
- Create a PR with your changes
- Comment on the PR and tag a maintainer, asking them to add the
trigger: previewlabel - A maintainer will add the label to trigger the preview release
- Use the generated package URLs to test your changes in other projects
This allows you to test package changes without waiting for an official release, while ensuring preview releases are controlled by maintainers.
Official releases are handled by maintainers using Nx Release. You can read more in the RELEASE.md
- Documentation: supabase.com/docs
- Community: GitHub Discussions
- Issues: GitHub Issues
- Discord: Supabase Discord
When reporting issues, please include:
- Clear description of the problem
- Steps to reproduce the issue
- Expected vs actual behavior
- Environment information (Node.js version, library versions, etc.)
- Code examples or minimal reproduction cases
- General questions: Use GitHub Discussions
- Bug reports: Use GitHub Issues
- Feature requests: Use GitHub Issues with the "enhancement" label
We are committed to providing a welcoming and inspiring community for all. Please review our Code of Conduct before participating.
By contributing to Supabase JS Libraries, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Supabase! 💚