Skip to main content
Add legally binding e-signatures to any Supabase application. Use Supabase Edge Functions to call the Firma API, store signing status in your Postgres database, and receive real-time updates via webhooks.

What you can build

  • Contract signing flows — trigger signing requests when users complete a form or checkout
  • Document status dashboards — track which documents are pending, signed, or declined
  • Embedded signing — let users sign documents without leaving your app
  • Automated workflows — use Firma webhooks + Supabase database triggers to kick off downstream actions when documents are signed

Prerequisites

Architecture overview

Your frontend calls a Supabase Edge Function, which securely calls the Firma API to create signing requests. When recipients sign (or decline), Firma sends a webhook to another Edge Function that updates your database.

Step 1: Store your Firma API key

Add your Firma API key as a Supabase secret so Edge Functions can access it securely:

Step 2: Create a table to track signing requests

Run this SQL in the Supabase SQL Editor to create a table for tracking document status:

Step 3: Create an Edge Function to send signing requests

Generate a new Edge Function:
Then replace the contents of supabase/functions/send-signing-request/index.ts:
Deploy it:

Step 4: Handle Firma webhooks

Create another Edge Function to receive webhook events from Firma when documents are signed, declined, or updated:
Replace the contents of supabase/functions/firma-webhook/index.ts:
Deploy it and make it publicly accessible (webhooks don’t send auth headers):
Then register the webhook URL in your Firma dashboard under Settings → Webhooks. Your endpoint URL will be:
For production use, verify the webhook signature using your Firma webhook signing secret. See the webhooks guide for details on signature verification.

Step 5: Embed the signing experience (optional)

For an in-app signing experience, use Firma’s embeddable signing component. Once you have the signing_request_user_id from the API response, load it in an iframe:
See the embedded signing guide for full setup instructions including security best practices.

Step 6: Query signing status from your frontend

With Row Level Security in place, your frontend can query the signing status directly:

Next steps