Firma lets you add legally binding e-signatures to any Replit application. Use Replit’s Node.js or Python backend to call the Firma API, manage templates, send signing requests, and track completions via webhooks. This guide covers three integration paths: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.
- Node.js + Express — Add a backend route that calls the Firma REST API. Best when your app is already using JavaScript or TypeScript.
- Python + Flask — Same concepts, Python syntax. Best when your app is already using Python.
- Replit Agent prompt — Let Replit Agent wire up the Firma integration for you from a natural language prompt. Works for any app.
Prerequisites
- A Firma account with an API key
- A Replit account (the free Starter plan includes daily Agent credits; deployments require a paid plan)
- 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: Node.js + Express
You add a backend route that calls the Firma REST API using your API key stored as a Replit Secret.Step 1: Store your API key as a Replit Secret
- Open your Repl
- Open the Secrets tool from the left tool dock (or search for “Secrets” using the search bar)
- Click New Secret
- Set the key to
FIRMA_API_KEYand paste your Firma API key as the value
Replit workspace secrets do not automatically carry over to deployments. After you add a secret in the workspace, also add it in the Publish pane under its own Secrets section before publishing. This is the single most common reason a Firma integration works in development but fails in production.
Step 2: Create a backend route to send signing requests
Add a route to your Express server. This example uses thecreate-and-send endpoint to create a signing request from a template and send it in a single API call:
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: Connect the route to your app UI
Call the backend route from your frontend:Webhook integration
To track when documents are signed, add a second route to receive Firma webhook events.- Add a
POST /api/firma-webhookroute to your Express server - Publish your Repl so it has a public HTTPS URL (for example
https://your-app.replit.app) - In the Firma dashboard under Settings → Webhooks, register a webhook pointing to
https://your-app.replit.app/api/firma-webhook - Firma sends events for key state changes — see the webhooks guide for all event types
Webhook endpoints only work on published Repls, not the development URL. Publish your app via Autoscale or Reserved VM before registering the webhook. Static deployments do not support backend routes.
Path 2: Python + Flask
Same integration, Python syntax. Useful if your Repl is already running Flask or FastAPI.Step 1: Store your API key
Same as Path 1: open the Secrets tool, addFIRMA_API_KEY with your Firma API key as the value.
Step 2: Create a Flask route
Path 3: Build the integration with Replit Agent
If you are using Replit Agent to generate your app, you can skip writing the boilerplate yourself. Give Agent a prompt like this:FIRMA_API_KEY to Secrets. For accurate API details during generation, connect the Firma Docs MCP server (see below), and Agent will pull the latest endpoint schemas directly from the Firma docs.
Embedded signing
For apps where signers complete documents directly in your UI instead of a separate Firma page, embed the signing experience in an iframe. 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 your Replit app:
Bonus: MCP connection for AI-assisted building
Firma provides a Docs MCP server you can connect to Replit Agent. Once connected, Agent can search the Firma docs while generating code, so it writes integrations with the correct endpoints, parameters, and auth headers instead of guessing. To set it up:- Go to the Integrations page in Replit
- Scroll to MCP Servers for Replit Agent and click Add MCP server
- Give it a name like
firma-docs - Enter the server URL:
https://docs.firma.dev/mcp - Click Test & Save
Multi-tenant SaaS: Customer Workspaces
If you are building a multi-tenant SaaS app on Replit where each of your customers needs their own isolated signing environment, use Firma Customer Workspaces. Each customer gets a private workspace with their own templates, signing requests, and usage tracking, with no data bleed between tenants. Create a new workspace from your backend when a customer signs up, and store their workspace ID and API key alongside the rest of their tenant record.Next steps
- Complete setup guide — end-to-end Firma integration walkthrough
- 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
- API reference — full endpoint documentation