supabasephp / supabase
A modular, secure, and developer-friendly Supabase SDK for PHP.
Requires
- php: ^8.4
- supabasephp/auth: dev-main
- supabasephp/client: dev-main
- supabasephp/core: dev-main
- supabasephp/database: dev-main
- supabasephp/functions: dev-main
- supabasephp/http: dev-main
- supabasephp/realtime: dev-main
- supabasephp/storage: dev-main
- supabasephp/vector: dev-main
Requires (Dev)
- fakerphp/faker: ^1.24
- laravel/pint: ^1.0
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.0
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-11 03:33:12 UTC
README
A modern, modular and strongly typed Supabase SDK for PHP.
SupabasePHP is an independent PHP SDK designed to provide a clean, consistent and developer-friendly interface for interacting with Supabase services.
Built for PHP 8.4+, the project follows a modular architecture in which each Supabase service is maintained as an independent Composer package.
Features
- Modular Composer package architecture.
- Native cURL HTTP transport.
- Authentication and session management.
- PostgreSQL database operations through PostgREST.
- Fluent database query builder.
- File uploads and downloads.
- Realtime subscriptions through WebSockets.
- Supabase Edge Functions.
- Vector search and pgvector integration.
- PSR interoperability.
- Strict typing and PHPDoc support.
- Unit and integration testing.
- Static analysis with PHPStan.
Requirements
- PHP 8.4 or higher.
- Composer 2.x.
- PHP cURL extension.
- PHP JSON extension.
- OpenSSL extension for supported secure transports.
Additional requirements may apply to individual packages.
Packages
| Package | Description |
|---|---|
supabasephp/client |
Main SDK and service integration |
supabasephp/core |
Shared contracts and utilities |
supabasephp/http |
HTTP transport and PSR interoperability |
supabasephp/auth |
Authentication and session management |
supabasephp/database |
PostgREST database client |
supabasephp/storage |
File and bucket management |
supabasephp/realtime |
WebSocket subscriptions |
supabasephp/functions |
Edge Functions |
supabasephp/vector |
Vector search and pgvector integration |
Each package can be installed independently when its dependencies are satisfied.
Installation
Install the complete SDK:
composer require supabasephp/client
Install an individual service:
composer require supabasephp/database composer require supabasephp/auth
Quick Start
<?php declare(strict_types=1); use Supabase\Client; $client = new Client([ 'url' => $_ENV['SUPABASE_URL'], 'key' => $_ENV['SUPABASE_KEY'], ]);
Authentication
$session = $client->auth()->signInWithPassword([ 'email' => 'user@example.com', 'password' => 'your-password', ]);
Database
$users = $client ->from('users') ->select('id, name, email') ->where('status', '=', 'active') ->order('created_at', 'desc') ->limit(20) ->get();
Storage
$storage = $client->storage(); $storage ->from('avatars') ->upload('profile.png', $file);
Edge Functions
$response = $client->functions()->invoke( 'hello-world', [ 'body' => [ 'name' => 'Developer', ], ] );
Security
Never expose Supabase secret or service-role credentials in frontend applications.
Keep sensitive credentials in server-side environment variables.
For security vulnerabilities, please follow the instructions in "SECURITY.md".
Contributing
Contributions are welcome.
Before submitting a pull request:
- Follow the project's coding standards.
- Add or update relevant tests.
- Run PHPStan.
- Run PHPUnit.
- Run Laravel Pint.
- Document significant changes.
Read CONTRIBUTING.md before contributing.
License
SupabasePHP is open-source software licensed under the MIT License.
See "LICENSE" for details.