Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

supabase_functions

Python client for Supabase Edge Functions. Most users use it through the supabase package, as client.functions.

Installation

The package needs an HTTP client adapter, for example httpx:

pip install supabase_functions "supabase_utils[httpx]"
uv add supabase_functions "supabase_utils[httpx]"

Supabase Service Compatibility

Only the latest Supabase Edge Runtime release is guaranteed to work. Older releases are supported on a best-effort basis. If you self-host, upgrade the Edge Runtime when you upgrade this SDK.

Usage

The client takes the URL of your functions, the headers to send and an HTTP session. Send the publishable key in the apikey header. For a function that verifies the caller's JWT, also send Authorization: Bearer <access token>.

A str body is sent as text and bytes as binary data. A dict, a list or a pydantic model is sent as JSON, with a date, datetime or UUID in it as its string. response.json() decodes a JSON answer.

An error status raises FunctionsHttpError, and a function the relay could not reach raises FunctionsRelayError.

from httpx import AsyncClient
from supabase_functions import (
    AsyncFunctionsClient,
    FunctionsHttpError,
    FunctionsRelayError,
)
from supabase_utils.http.adapters.httpx import AsyncHttpxSession

async with AsyncHttpxSession(AsyncClient()) as session:
    functions = AsyncFunctionsClient(
        "https://<project_ref>.supabase.co/functions/v1",
        {"apikey": "your-publishable-key"},
        session,
    )
    try:
        response = await functions.invoke(
            "payment-sheet", body={"amount": 1000, "currency": "usd"}
        )
        print(response.json())
    except (FunctionsHttpError, FunctionsRelayError) as error:
        print(error.status_code, error.message)

SyncFunctionsClient works the same way with an HttpxSession and without await.

Streaming responses

invoke_stream() takes the arguments of invoke() and returns the response as soon as its head arrives, for example for server-sent events. Read the body once with iter_text(), iter_events(), read() or by iterating over it.

request_timeout limits the time between two chunks, not the whole stream. A total timeout of the HTTP client still applies, such as the 300 seconds of a default aiohttp ClientSession.

from httpx import AsyncClient
from supabase_functions import AsyncFunctionsClient
from supabase_utils.http.adapters.httpx import AsyncHttpxSession

async with AsyncHttpxSession(AsyncClient()) as session:
    functions = AsyncFunctionsClient(
        "https://<project_ref>.supabase.co/functions/v1",
        {"apikey": "your-publishable-key"},
        session,
    )
    async with functions.invoke_stream(
        "chat", body={"prompt": "Hello"}
    ) as response:
        async for event in response.iter_events():
            print(event.event, event.data)

Metadata

Release files for supabase_functions 3.0.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for supabase_functions 3.0.0a2
File Size Uploaded Provenance Actions
supabase_functions-3.0.0a2.tar.gz 9.4 kB Without provenance Details for supabase_functions-3.0.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for supabase_functions 3.0.0a2
File Interpreter ABI Platform Actions
supabase_functions-3.0.0a2-py3-none-any.whl Python 3 none any Details for supabase_functions-3.0.0a2-py3-none-any.whl

Total release size: 20.4 kB

Release files / supabase_functions-3.0.0a2.tar.gz

Download URL supabase_functions-3.0.0a2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
acc26110551534810f4be26b79b9cc050b2b5b08c5dba2f2467e556b969715cd
BLAKE2b-256 checksum
How to use checksums
3aea48431a3f8d397b45beadf298a1153b5209f2f1a9ec8944b2efe2319b47ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / supabase_functions-3.0.0a2-py3-none-any.whl

Download URL supabase_functions-3.0.0a2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ce24b49a133c7c34faad458c652844a8622f48c1eca2e62541db0fe7f46caee
BLAKE2b-256 checksum
How to use checksums
c6f56150dfd9d7016f84841f7fad8ee410c3c4559f95b63ff0a010c080fba15c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for supabase_functions 3.0.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page