Skip to main content

Library for Supabase Functions

Project description

Functions-py

Installation

The package can be installed using pip, uv or poetry:

Pip

pip install supabase_functions

UV

uv add supabase_functions

Poetry

poetry add supabase_functions

Usage

Deploy your Edge Function following the Supabase Functions documentation.

Asynchronous Client

import asyncio
from supabase_functions import AsyncFunctionsClient

async def run_func():
    # Initialize the client with your project URL and optional headers
    headers = {
        "Authorization": "Bearer your-publishable-key",
        # Add any other headers you might need
    }
    
    fc = AsyncFunctionsClient("https://<project_ref>.functions.supabase.co", headers)
    
    try:
        # Invoke your Edge Function
        res = await fc.invoke("payment-sheet", {
            "responseType": "json",
            "body": {"amount": 1000, "currency": "usd"}
        })
        print("Response:", res)
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    asyncio.run(run_func())

Synchronous Client

from supabase_functions import SyncFunctionsClient

# Initialize the client
headers = {"Authorization": "Bearer your-publishable-key"}
fc = SyncFunctionsClient("https://<project_ref>.functions.supabase.co", headers)

# Invoke your Edge Function
try:
    res = fc.invoke("payment-sheet", {
        "responseType": "json", 
        "body": {"amount": 1000, "currency": "usd"}
    })
    print("Response:", res)
except Exception as e:
    print(f"Error: {e}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supabase_functions-2.30.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supabase_functions-2.30.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file supabase_functions-2.30.1.tar.gz.

File metadata

  • Download URL: supabase_functions-2.30.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.2

File hashes

Hashes for supabase_functions-2.30.1.tar.gz
Algorithm Hash digest
SHA256 c09f8b46d3cf85713e2d8bf879dd77905ceb1d73508dbc404cc35cb36e75fb42
MD5 0faaa4aa5cc2bf7456cad896e3050dda
BLAKE2b-256 88086d00627295f196c5f4c6a70945a3e7339712321511d1377d6262db4dff89

See more details on using hashes here.

File details

Details for the file supabase_functions-2.30.1-py3-none-any.whl.

File metadata

File hashes

Hashes for supabase_functions-2.30.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d756b5bb5444c1edd43f2f44bb7698ddb242a8bc9f9eb2f8fa04ba55799e0ba
MD5 a927aeaeb9c172bc23adaca85cf7445b
BLAKE2b-256 0c9f4058525e93e6fdcd5c7f216acefe956a3a16001c3c2a1d01b205c7b11eb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page