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-functionsVerified import paths — ran on the pinned version, not inferred.
Initializes the SupabaseFunctionsClient and demonstrates how to invoke a deployed Edge Function with a JSON payload. Requires `SUPABASE_URL` and `SUPABASE_KEY` environment variables.
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.
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"}})`.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.