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-anon-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-anon-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.28.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.28.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: supabase_functions-2.28.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.28.1.tar.gz
Algorithm Hash digest
SHA256 bbb031e5f19133d39e8fb802216f7e98e2f44871475d70d44dfc6b3aa331fdf0
MD5 951c3d2b711648a91a79e1c6acb8c1ad
BLAKE2b-256 dd122d9646a455ffcd3f8307881faa6f0da7a1bff7f42e84dca708f8dcd0a2a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for supabase_functions-2.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e62290f32936dbbe4bebee680d90de1ecee354ccac6878aa871e05a71067be
MD5 cc7383d91b3e7b10514d7447d087ca62
BLAKE2b-256 cca113a9019f8e6d620bd17d60df8c4d64e1611ccb2bf1764dd87da685dad89f

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