Firma lets you add legally binding e-signatures to any v0 application. Use Next.js route handlers to call the Firma REST API, send signing requests, and receive webhook events when documents are signed. This guide walks through the full flow: storing your API key, sending a signing request, wiring it to your UI, and handling completion events.Documentation Index
Fetch the complete documentation index at: https://docs.firma.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Firma account with an API key
- A v0 account with an active project (free tier works)
- At least one Firma template with signing fields configured
Firma uses the raw API key as the
Authorization header value — do not prefix it with Bearer. This differs from many other APIs.Step 1: Store your API key as an environment variable
v0 manages environment variables through the Vars panel in the chat sidebar. Values are synced with the connected Vercel project, so the same secret works in previews and in production.- Open your v0 project and click the Vars tab in the sidebar
- Click Add Variable
- Set the key to
FIRMA_API_KEYand paste your Firma API key as the value - Save
process.env.FIRMA_API_KEY in any server-side code v0 generates.
Step 2: Create a route handler to send signing requests
Ask v0 to create a route handler, or add the file directly. v0 generates Next.js App Router code by default, so route handlers live inapp/api/<route-name>/route.ts.
This example creates and sends a signing request from a template in a single call using the create-and-send endpoint:
The
create-and-send endpoint creates the signing request and sends it to recipients atomically. If you need to review or modify the request before sending, use POST /signing-requests to create a draft, then POST /signing-requests/{id}/send separately.Step 3: Call the route handler from your UI
From a client component, POST to your new route when the user completes the form:/api/send-signing-request with the template ID, signer email, first name, and last name from the form.” v0 will generate the form, the button, and the fetch call together.
Webhook integration
To track when documents are signed, add a webhook route handler and register it in the Firma dashboard.- Publish your app (see below) so the route is publicly reachable
- In the Firma dashboard under Settings → Webhooks, add a webhook pointing to
https://<your-app-domain>/api/webhooks/firma - Select the events you want to receive. See the webhooks guide for all event types and signature verification
Publishing to Vercel
v0 projects connect to a Vercel project automatically. To push your app to production:- Click Publish in the top right of the v0 interface, or connect an existing Vercel project from Project settings
- Environment variables set in the Vars panel sync to Vercel automatically. To scope values per environment (Production, Preview, Development), edit them under Project → Settings → Environment Variables in the Vercel dashboard
- Once published, your webhook URL will be
https://<project-name>.vercel.app/api/webhooks/firma. Use that when registering the webhook in Firma
If you need a different Firma API key for preview vs. production, set
FIRMA_API_KEY per environment in the Vercel dashboard. v0’s Vars panel writes to all environments by default.Embedded signing
For apps where signers complete documents inside your UI instead of jumping to email, Firma provides an embeddable signing experience. Thecreate-and-send response includes a first_signer.id (the signing_request_user_id) and a ready-made first_signer.signing_link. Render it in an iframe:
Bonus: MCP connection for AI-assisted building
Firma offers a Docs MCP server that v0’s chat can connect to directly. When connected, v0 searches Firma documentation while generating code so it uses accurate endpoints, field names, and patterns. To set it up:- In v0, click Add MCP on the prompt form or go to Settings → MCP Connections
- Add a custom MCP server with the URL:
https://docs.firma.dev/mcp - Save
abc123 using the email in the form” will generate code that matches the current Firma API. This is a build-time aid and does not affect your deployed app.
Next steps
- API authentication — API keys and workspace scoping
- Webhooks guide — event types, payloads, and signature verification
- Embedded signing — in-app signing experience
- Creating workspaces — multi-tenant setups for SaaS apps
- Complete setup guide — end-to-end Firma integration walkthrough
- API reference — full endpoint documentation