Registry / gcp / supabase-functions

supabase-functions

JSON →
library2.31.0pypypi✓ verified 28d ago

The `supabase-functions` Python library provides a client to interact with Supabase Edge Functions. It allows Python applications to invoke serverless functions deployed on Supabase's global edge network, handling invocation details and response parsing. Current version is 2.28.3, and it typically sees updates aligned with the broader Supabase ecosystem and bug fixes.

pip install supabase-functions
INSTALL
IMPORT
SIG · SUPABASE-FUNCTIONS
S
supabase-functions
gcppythonv2.31.0
Install
3.3s avg
Import
245ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.31.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.254s · 24.7MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.3s · import 0.236s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncFunctionsClient
✓ from supabase_functions import AsyncFunctionsClient
✗ from supabase_functions import SupabaseFunctionsClient
SyncFunctionsClient
✓ from supabase_functions import SyncFunctionsClient
✗ from supabase_functions import SupabaseFunctionsClient
create_client
✓ from supabase_functions import create_client
✗ from supabase_functions import SupabaseFunctionsClient

Initializes the SupabaseFunctionsClient and demonstrates how to invoke a deployed Edge Function with a JSON payload. Requires `SUPABASE_URL` and `SUPABASE_KEY` environment variables.

import os from supabase_functions import SupabaseFunctionsClient supabase_url = os.environ.get('SUPABASE_URL', 'YOUR_SUPABASE_URL') supabase_key = os.environ.get('SUPABASE_KEY', 'YOUR_SUPABASE_KEY') if supabase_url == 'YOUR_SUPABASE_URL' or supabase_key == 'YOUR_SUPABASE_KEY': print("Warning: Please set SUPABASE_URL and SUPABASE_KEY environment variables or replace placeholders.") exit() client = SupabaseFunctionsClient(supabase_url, supabase_key) try: # Invoke a function named 'my-function' with a JSON body response = client.invoke( "my-function", invoke_options={ "body": {"name": "World"}, "headers": {"Content-Type": "application/json"} } ) print("Function invoked successfully:") print(response.json()) except Exception as e: print(f"Error invoking function: {e}") # Example of a common error if function does not exist or network issue if "Name or service not known" in str(e): print("Hint: Check your SUPABASE_URL and network connectivity.") elif "404 Client Error" in str(e): print("Hint: Ensure 'my-function' is deployed and the name is correct.")
Debug
Known issues
gotchaIncorrect `supabase_url` or `supabase_key`. Misconfiguration often leads to `AuthApiError`, `HTTPError` (e.g., 401 Unauthorized), or `ConnectionError` when invoking functions.
fix
Ensure `SUPABASE_URL` and `SUPABASE_KEY` are correctly set and correspond to your Supabase project. For client-side invocation, the `anon` key is typically used; for server-side, a service role key might be required.
affects: All
gotchaImproper use of `invoke_options`. The function body and other HTTP options (like `headers` or `query_params`) must be passed as a dictionary under the `invoke_options` argument, not directly as separate arguments to the `invoke` method.
fix
Pass a dictionary to `invoke_options` with keys like `body`, `headers`, or `query_params`. For example: `client.invoke("my-function", invoke_options={"body": {"data": "value"}, "headers": {"Content-Type": "application/json"}})`.
affects: All
gotchaEnsure the Edge Function is deployed and accessible. Failures might occur if the function name is misspelled, it's not deployed to the target region, or there are network access restrictions/CORS issues.
fix
Verify the function name exactly matches the deployed function's name. Check your Supabase dashboard to confirm the function's deployment status and ensure any necessary CORS configurations are in place if invoking from a browser.
affects: All
Upgrade
Version history
2.31.0latest on PyPI · released Jun 4, 2026
Audit
Dependencies
supabase-pyrequiredUnderlying Supabase client for shared functionality like auth handling.
Agent activity
44 hits · last 30 days
node
38
OpenAI (training)
1
Resources
supabase-functions — pip install supabase-functions · libregistry