- Path 1: Next.js API routes (full-stack) — The most common Bolt.new pattern. Server-side API routes proxy calls to Firma and keep your API key out of client code. Best for apps that stay on Bolt Cloud or deploy anywhere.
- Path 2: Netlify serverless functions — Bolt has built-in Netlify deployment. Serverless functions handle Firma API calls at the edge without managing a server. Best for static frontends that need a lightweight backend.
- Path 3: Supabase Edge Functions — If your Bolt app already uses Supabase for auth and database, you can call Firma from Edge Functions and track signing status in Postgres. See the full Supabase integration guide.
Prerequisites
- A Firma account with an API key
- A Bolt.new account (a paid plan is recommended for private projects and custom deployment)
- 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.Path 1: Next.js API routes
This is the recommended approach for most Bolt.new projects. You scaffold a Next.js app, add a server-side API route that calls Firma, and your frontend calls that route. Your API key never touches the browser.Step 1: Create your project
Open bolt.new and prompt it to scaffold a Next.js project. You can be specific:“Create a Next.js app with TypeScript and Tailwind CSS. I need a page where users can enter a signer’s name and email, then send a contract for signing via an external API.”Bolt will generate the project structure, install dependencies, and start the dev server.
Step 2: Add your Firma API key
For local development in the Bolt WebContainer, create a.env.local file in the root of your project. You can ask Bolt to create it, or add it manually in the file tree:
FIRMA_API_KEY.
Step 3: Create an API route to send signing requests
Create a new file atapp/api/send-signing-request/route.ts (or ask Bolt to generate it). This route receives signer details from your frontend and calls the Firma API server-side:
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 4: Call the API route from your frontend
In your React component, call the API route when the user submits the form:/api/send-signing-request endpoint with the template ID, signer email, and name from the form fields.”
Step 5: Deploy
Bolt Cloud: Click Publish in the top-right corner of the editor. Bolt assigns a random*.bolt.host URL you can customize afterward. Store FIRMA_API_KEY via the database icon → Secrets tab so your API routes can read it.
Netlify: Click the gear icon → All project settings → Domains & Hosting, then select Netlify from the provider dropdown and click Publish. After deploying, add FIRMA_API_KEY in Netlify’s dashboard under Site Settings → Environment Variables.
Vercel or other hosts: Export the project to GitHub, then connect the repository to your host. Add FIRMA_API_KEY as an environment variable in your host’s dashboard.
Path 2: Netlify serverless functions
If your Bolt project uses a framework without built-in API routes (React with Vite, plain HTML, Astro in static mode), Netlify serverless functions give you a backend without restructuring your app.Step 1: Create the function directory
Create a directory atnetlify/functions/ in the root of your Bolt project. Netlify automatically detects and deploys functions from this path.
Step 2: Add the signing request function
Createnetlify/functions/send-signing-request.ts:
Step 3: Call the function from your frontend
Netlify functions are available at/.netlify/functions/<function-name>:
Step 4: Configure environment variables and deploy
- In Bolt, click the gear icon → All project settings → Domains & Hosting and select Netlify
- Click Publish to deploy
- In Netlify’s dashboard, go to Site Settings → Environment Variables
- Add
FIRMA_API_KEYwith your Firma API key as the value
Path 3: Supabase Edge Functions
If your Bolt app uses Supabase for authentication and database, you can handle Firma API calls through Supabase Edge Functions and track signing request status in Postgres. This path is covered in detail in the Supabase integration guide. It walks through storing your API key as a Supabase secret, creating Edge Functions for sending signing requests and handling webhooks, and setting up asigning_requests table with Row Level Security.
To connect Supabase in Bolt, use the built-in Supabase integration or ask Bolt’s AI chat: “Connect this project to Supabase and add the Supabase client library.”
Webhook integration
To track when documents are signed, set up a Firma webhook that points to your app. The setup depends on which path you chose.Next.js API route
Createapp/api/firma-webhook/route.ts:
Netlify serverless function
Createnetlify/functions/firma-webhook.ts:
Register the webhook
In the Firma dashboard under Settings → Webhooks, register a webhook pointing to your endpoint:- Next.js (Bolt Cloud):
https://your-app.bolt.host/api/firma-webhook - Next.js (Netlify):
https://your-site.netlify.app/api/firma-webhook - Netlify function:
https://your-site.netlify.app/.netlify/functions/firma-webhook
Embedded signing
For apps where signers complete documents directly in your UI, 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. Load the signer URL in an iframe inside your Bolt app:
Bonus: MCP connection for AI-assisted building
Firma offers a Docs MCP server that you can connect to Bolt.new. This lets the Bolt AI chat search Firma documentation while you build, so it can help you write integration code with accurate API details. To set it up:- From the Bolt chatbox, click the plus icon
- Select Connectors, then Manage connectors
- Click Add custom connector
- Set a descriptive name (e.g., “Firma Docs”)
- Enter the server URL:
https://docs.firma.dev/mcp - Choose the transport type and authentication (none is required for the public docs server)
- Click Add
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
- Supabase integration — full Supabase + Firma walkthrough
- Complete setup guide — end-to-end Firma integration walkthrough
- API reference — full endpoint documentation