# Add e-signatures and clickwrap to a Render app

> Add e-signatures and clickwrap to a Render app: the esigncomply package in a Node.js web service, the key behind sync: false in render.yaml, and Postgres.

Source: https://esigncomply.com/render

Platform · Render

To add e-signatures and clickwrap to a Render app, run the `esigncomply` package in a Node.js web service and declare the secret key in `render.yaml` with `sync: false`, so the file never holds it. The service creates the session and confirms the record, and Render Postgres keeps the receipt. Esign Comply seals each acceptance as an independent record.

Follow the quickstart and each signature is a valid electronic signature under the U.S. ESIGN Act, state UETA laws and New York's ESRA, and each clickwrap is built the way courts require: clear notice of the terms, an unmistakable act of assent, and a sealed record of both.

[Get an API key](https://esigncomply.com/signup) · [Read the docs](https://esigncomply.com/docs/quickstart/render)

`npm install esigncomply pg`

[Render quickstart](https://esigncomply.com/docs/quickstart/render)

Free plan: 10 live signatures a month and a full test mode. No card required.

Last updated November 26, 2026

Run locally for Render before publishing

**Web service**

server.js (excerpt)

```js
// Step 4: create the session with the secret key. The browser gets the client token only.
if (req.method === "POST" && url.pathname === "/api/ceremony") {
  const { data: session, error } = await esc.sessions.create(
    {
      profile: process.env.ESIGNCOMPLY_PROFILE_ID,
      signer,
      documents: [
        { document: DOCUMENTS.terms, version: "current" },
        { document: DOCUMENTS.privacy, version: "current" },
      ],
      // The page that runs the ceremony: the origin the browser reports, plus its path.
      context: { url: `${req.headers.origin ?? url.origin}/signup`, locale: "en-US", purpose: "account_signup" },
    },
    { idempotencyKey: `signup-${signer.external_id}-${randomUUID()}` },
  );
  if (error) return json(res, 502, { error: error.code });
  // In Postgres, not in memory: the confirmation can reach another instance.
  await savePinned(signer.external_id, session.documents.map((d) => d.version_id).sort());
  return json(res, 200, { clientToken: session.client_token, apiUrl: session.api_url, documents: session.documents });
```

**render.yaml**

`render.yaml`

```yaml
# render.yaml
services:
  - type: web
    name: esigncomply-quickstart
    runtime: node
    buildCommand: npm ci
    startCommand: node server.js
    healthCheckPath: /health
    envVars:
      # sync: false makes Render ask for the value once, when the Blueprint is created.
      - key: ESIGNCOMPLY_API_KEY
        sync: false
      - key: ESIGNCOMPLY_PROFILE_ID
        sync: false
      - key: ESIGNCOMPLY_TERMS_ID
        sync: false
      - key: ESIGNCOMPLY_PRIVACY_ID
        sync: false
      # "true" on the service that holds the live key, "false" in every preview environment.
      - key: ESIGNCOMPLY_LIVE
        value: "true"
        previewValue: "false"
      # The internal URL of the database below.
      - key: DATABASE_URL
        fromDatabase:
          name: esigncomply-db
          property: connectionString

databases:
  - name: esigncomply-db
```

**Confirm**

server.js (excerpt)

```js
// Step 6: confirm the record with the secret key before the account exists.
if (req.method === "POST" && url.pathname === "/api/signup/confirm") {
  const { recordId } = await body(req);
  const { data: record, error } = await esc.records.get(String(recordId));
  const expected = await getPinned(signer.external_id);
  const confirmed =
    !error &&
    SEALED.includes(record.status) &&
    record.livemode === LIVE &&
    record.signer.external_id === signer.external_id &&
    JSON.stringify(record.documents.map((d) => d.version_id).sort()) === JSON.stringify(expected);
  console.log(confirmed ? `confirmed ${record.id} (${record.status})` : "refused");
  if (!confirmed) return json(res, 409, { confirmed: false });
  // Only now create the account. The record ID and the receipt go in the same row.
  await saveReceipt(signer.external_id, record.id, record.receipt);
  return json(res, 200, { confirmed: true, recordId: record.id });
```

**Live flag**

server.js (excerpt)

```js
// Live records only where the Blueprint sets ESIGNCOMPLY_LIVE to "true", and never in a pull request
// preview: Render copies the variables of the base service into it and sets IS_PULL_REQUEST to "true".
const LIVE = process.env.ESIGNCOMPLY_LIVE === "true" && process.env.IS_PULL_REQUEST !== "true";
```

Integrate with Render

## How do you integrate Esign Comply with Render?

On Render the server half is one Node.js web service, declared in a `render.yaml` Blueprint with its database. It listens on `0.0.0.0` on the port in `PORT`, and Render sends health checks to `/health` on each instance. Render load-balances a scaled service across its instances, so the pinned versions go to Render Postgres.

Render is a cloud application platform for deploying, securing, and scaling applications, from hundred-line prototypes to complex multi-service architectures.

Source: [Render documentation, llms.txt](https://render.com/llms.txt), read on November 25, 2026.

[Render quickstart](https://esigncomply.com/docs/quickstart/render) · [All platforms](https://esigncomply.com/platforms)

Where each part lives on Render

- **Web service** · `server.js`
- **render.yaml** · `render.yaml`
- **Confirm** · `server.js`
- **Live flag** · `server.js`

Run on 2026-11-26 with Node.js 24.22.1, the default version of Render's Node.js runtime on that date, started the way the Blueprint says (npm ci, then node server.js) with the variables Render sets (PORT, NODE_ENV, RENDER, IS_PULL_REQUEST), as two instances on one PostgreSQL 17 database, with esigncomply 1.0.4, pg 8.23.1, the browser SDK script build and the conformance check from esigncomply 1.0.4, against the API in test mode. render.yaml was checked against the JSON Schema Render publishes for Blueprints. The Render settings are from Render's documentation as of 2026-11-25. Nothing has been deployed to Render yet.

Three steps

## How does Esign Comply fit with Render?

Each step uses a feature Render already has. The secret key stays on the server side of Render in all three.

1. **An environment variable of the service holds the key**

   The Blueprint declares `ESIGNCOMPLY_API_KEY` with `sync: false`. Render asks for the value in the Dashboard when the Blueprint is first created, and the file never contains it. The SDK reads the key from `process.env`. Source: [Render documentation, Blueprint YAML Reference](https://render.com/docs/blueprint-spec), read on November 25, 2026.

2. **The web service creates the session**

   `POST /api/ceremony` runs in your Node.js web service. It calls `esc.sessions.create` and returns the client token. The same service serves the signup page, and the browser SDK records the ceremony from the signer's device. Source: [Render documentation, Web Services](https://render.com/docs/web-services), read on November 25, 2026.

3. **Render Postgres keeps the receipt**

   The session route stores the pinned versions in a table in Render Postgres. The Blueprint sets `DATABASE_URL` from the database's `connectionString`. The confirm route reads the record with the secret key, compares it with the row, and writes the record ID and the receipt into it. Source: [Render documentation, Create and Connect to Render Postgres](https://render.com/docs/postgresql-creating-connecting), read on November 25, 2026.

Render setup

## Where do the key, the preview hosts and the webhook go on Render?

Four settings carry an Esign Comply integration on Render. What is said here about Render was read from its own documentation, and the quickstart has each command.

### Environment variables

Render asks for a `sync: false` value only when the Blueprint is first created. To change the key later, or to add it to a service that already exists, set it on the service's Environment page. Variable values are always strings, so the server compares `ESIGNCOMPLY_LIVE` and `IS_PULL_REQUEST` with `"true"`.

Source: [Render documentation, Blueprint YAML Reference](https://render.com/docs/blueprint-spec), read on November 25, 2026.

### Instances, the health check and the port

A web service has to listen on `0.0.0.0`, on the port in `PORT`, which is `10000` unless you change it. Render sends health checks to each running instance every few seconds. The quickstart's `/health` answers `503` when the database does not.

Source: [Render documentation, Health Checks](https://render.com/docs/health-checks), read on November 25, 2026.

### Previews and test mode

Each preview has an `onrender.com` host of its own. A test key refuses a host it does not know: list the exact host under Domains in the Esign Comply dashboard as a test origin, and give the preview the test key and the test IDs. Never list the shared suffix `onrender.com`.

Source: [Render documentation, Service Previews](https://render.com/docs/service-previews), read on November 25, 2026.

### The registered domain and the webhook

Register your custom domain and verify it with one DNS record. A production service on its `onrender.com` host verifies with a file at `/.well-known/esigncomply.txt`. For the `record.completed` webhook, add a route to the service and register its production URL under Webhooks in the Esign Comply dashboard.

Read on November 25, 2026: [Render documentation, Web Services](https://render.com/docs/web-services), [Render documentation, Blueprint YAML Reference](https://render.com/docs/blueprint-spec), [Render documentation, Default Environment Variables](https://render.com/docs/environment-variables), [Render documentation, Service Previews](https://render.com/docs/service-previews), [Render documentation, Preview Environments](https://render.com/docs/preview-environments), [Render documentation, Health Checks](https://render.com/docs/health-checks), [Render documentation, Scaling Render Services](https://render.com/docs/scaling), [Render documentation, Create and Connect to Render Postgres](https://render.com/docs/postgresql-creating-connecting).

Copy-paste prompt

## What prompt adds Esign Comply clickwrap to a Render app?

Paste this into Cursor, Claude Code or the AI coding tool that is open on your project. It names the packages that exist, where the secret key goes on Render, what to build and what never to do, and it ends with the rules block for your project.

The rules block lives at [/rules.md](https://esigncomply.com/rules.md). Added to your project's instruction file, it makes every later session build signing and acceptance flows the same way. The [prompt generator](https://esigncomply.com/product/prompt-generator) writes the long version, with your own document and profile IDs.

[Pages for each AI tool](https://esigncomply.com/build)

Prompt: Esign Comply clickwrap on Render

```
Add Esign Comply clickwrap to my app on Render: a signup form where the user accepts the Terms of Service and the Privacy Notice with a checkbox and a button.

Read these first and follow them exactly. If something conflicts with existing code, or you are unsure how to implement a step, stop and ask. Do not invent API methods, packages or legal wording.
- https://esigncomply.com/docs/quickstart/render.md (the steps and the tested code for Render)
- https://esigncomply.com/setup.md (the order of API calls)
- https://esigncomply.com/auth.md (how to handle the keys)

Render facts
- Packages (the only ones that exist): esigncomply (server, Node.js 20.19 or later, an ES module) and @esigncomply/browser. Without a bundler, load the browser SDK from https://esigncomply.com/sdk/v1/esigncomply.js.
- The secret key is the environment variable ESIGNCOMPLY_API_KEY of the web service, declared in render.yaml with sync: false and typed into the Render Dashboard. Never write its value in render.yaml. Never print it.
- A web service listens on 0.0.0.0 on the port in PORT, 10000 by default.
- A service can run several instances. Keep the pinned version IDs in Render Postgres (DATABASE_URL, from the database's connectionString), never in a variable of the process. Give the pg pool an error listener.
- A pull request preview copies the variables of the base service and has IS_PULL_REQUEST set to "true". Never expect live records there.
- The page is on screen before the script has a session: render the checkbox disabled and enable it when observeAssent has resolved.

Build
1. Verify the key: GET /v1/usage with ESIGNCOMPLY_API_KEY. Stop if it fails.
2. Register the Terms of Service and the Privacy Notice as documents and publish one version of each from the documents in this project. If the project has none, register short sample documents and say so in your report. Never write or change the wording of the real documents. Create a profile: jurisdictions ["US-FED"], method "checkbox", assurance_level "L1".
3. Server: POST /api/ceremony creates the session with esc.sessions.create and an Idempotency-Key, saves the signer ID and the pinned version IDs in Postgres, and returns only clientToken, apiUrl and documents.
4. Server: GET /legal/terms and /legal/privacy render the registered version from esc.documents.versions.getContent inside <article data-esc-document>, unmodified.
5. Browser: EsignComply.attach({ clientToken, apiUrl }), presentDocument for each link, observeAssent({ region, checkbox, submit }), then complete() from the user's real click.
6. Server: POST /api/signup/confirm reads the record with esc.records.get and requires: status is "recorded", "timestamped" or "anchored"; livemode is as expected; the signer ID and version IDs equal the row in Postgres. Only then create the account, and store the record ID and the receipt in the same row.

Never
- Never pre-check the box, auto-submit, or call .click() on the user's behalf.
- Never use "By continuing" or "By clicking below" wording. The notice names the button by its label and each document by its registered name.
- Never put the secret key, or any call that uses it, in code that reaches the browser.
- Never show "signed" or "accepted" before the server has confirmed the record.
- Never fall back to an acceptance with no record when a session is refused.

Check before you report success
- Run: npx esigncomply check --url http://localhost:10000/signup --callback http://localhost:10000/api/signup/confirm
  Fix every finding marked "block". List every finding marked "warn".
- Report the files you created or changed, anything you did not implement and why, and the conformance summary.

Then add the rules block to this project's instruction file: https://esigncomply.com/rules.md
```

3 things to watch

## What goes wrong when you add e-signatures on Render?

These are specific to Render. Each one was seen while the quickstart's code was run, or is in Render's own documentation.

- **A pull request preview copies the live key**

  Render's documentation says a preview instance copies all settings of its base service, environment variables included. A live key works only on your registered domain, so a session on the preview's `onrender.com` host is refused with `domain_mismatch`. Replace the key and the IDs on the preview instance with the test ones.

  Source: [Render documentation, Service Previews](https://render.com/docs/service-previews), read on November 25, 2026.

- **A preview environment starts without the key**

  Render does not copy `sync: false` variables into a preview environment built from the Blueprint, so the session route answers `missing_api_key` there. Put the test key in an environment group you create in the Dashboard and reference it with `fromGroup`. A value set on the service itself takes precedence over a group.

  Source: [Render documentation, Preview Environments](https://render.com/docs/preview-environments), read on November 25, 2026.

- **Without a listener on the pool, a closed connection stops the instance**

  In the test, the database closed an idle connection and the Node.js process exited with `terminating connection due to administrator command`: `pg` 8.23.1 raised the error on the pool and nothing listened for it. With the one-line listener in `store.js`, the instance logged the message and answered the next request.

## Where are the Render quickstart and the API reference?

Start with the quickstart: it carries every file this page excerpts, in the order you write them.

- Quickstart

  **[Render quickstart](https://esigncomply.com/docs/quickstart/render)**

  Step by step, from install to your first sealed test record, with every file and the output of each step.

- Reference

  **[API reference](https://esigncomply.com/docs/api)**

  Every endpoint, field and error code. Sessions, records and documents are the three this page uses.

- Guide

  **[Server confirmation](https://esigncomply.com/docs/guides/server-confirmation)**

  The one place access is granted: what to compare, and the webhook that backs the check up.

Verifiable

## What does Esign Comply record for a signature on Render?

The same record on every stack and platform. Your Render code creates the session and confirms the record, and the browser SDK reports what happened on the page. Esign Comply seals the result where your code cannot change it. The record itself is described on [Evidence and verification](https://esigncomply.com/product/evidence).

- **Observed and asserted fields**

  Every field is tagged. Observed is what the browser SDK and the API saw: the box unchecked at load, the tick from a trusted user event, the notice text, the terms version by hash, the server time. Asserted is what your app said, such as the user's email.

- **A signed receipt**

  `complete()` returns a receipt signed with ES256, using keys you do not hold. Your server stores it next to the user, and `GET /v1/records/{id}/receipt` returns it again.

- **An external timestamp**

  An outside authority timestamps the hash of every live record (RFC 3161), so the time on the record does not rest on your clock or on ours.

- **An offline verifier**

  Each record has an evidence report (PDF) and an evidence package (ZIP). Anyone you send the package to checks the acceptance with the open-source `esigncomply-verify`, without an account.

[How sealing and verification work](https://esigncomply.com/product/evidence) · [Observed and asserted, in the docs](https://esigncomply.com/docs/concepts/observed-and-asserted) · [The offline verifier](https://esigncomply.com/docs/sdk/verify)

Record

`rec_Z4m8`

simple · L1

Recorded

Written durably, receipt signed with ES256

Timestamped

External RFC 3161 token over the record hash

Anchored

Public anchor pending

Checkbox changed by a trusted user event · observed

Terms of Service, version dv_3kT9 · observed

Server time 2026-11-21T15:03:20.291Z · observed

Signer email dana@example.org · asserted

record_hash sha256:5be7… · example record

## Questions about e-signatures on Render

### How does test mode work on Render preview URLs?

Each preview answers on an `onrender.com` host of its own, which a test key refuses until you list that exact host under Domains as a test origin. A pull request preview copies the variables of its base service, so replace the live key with the test key there. On `localhost` a test key works with no setup.

### Where should the receipt be stored on Render?

In Render Postgres, beside the signer ID and the record ID. The confirm route writes both once the record is confirmed. The quickstart's Blueprint declares the database and uses one row for the pinned versions and the receipt.

### Why does the server check IS_PULL_REQUEST?

Because a pull request preview copies the variables of its base service, `ESIGNCOMPLY_LIVE` included, and Render sets `IS_PULL_REQUEST` to the string `true` in a preview. In the test, an instance with both set accepted a test record, and one with `ESIGNCOMPLY_LIVE` alone refused it with `409`.

### Does render.yaml ever contain the secret key?

No. The Blueprint declares `ESIGNCOMPLY_API_KEY` with `sync: false`, and Render asks for the value in the Dashboard when the Blueprint is first created. The file in the quickstart was checked against the JSON Schema that Render publishes for Blueprints.

### Was this code run on Render's own runtime?

Not yet. Render's Node.js runtime runs on Render, so the code ran locally on Node.js 24.22.1, that runtime's default version on November 25, 2026, started the way the Blueprint says, as two instances on one database. The Blueprint, previews and the `onrender.com` host are proven only by a deployment.

### Other platforms

- [Railway](https://esigncomply.com/railway)
- [Fly.io](https://esigncomply.com/fly-io)
- [Google Cloud Run](https://esigncomply.com/google-cloud-run)

### Stacks used with Render

- [Node.js](https://esigncomply.com/nodejs)
- [Express](https://esigncomply.com/express)
- [Next.js](https://esigncomply.com/nextjs)

[All platforms](https://esigncomply.com/platforms) · [All stacks](https://esigncomply.com/stacks) · [Clickwrap API](https://esigncomply.com/clickwrap) · [E-signature API](https://esigncomply.com/sign)

## Run the signing flow in your Render web service. Leave the record to us.

[Get an API key](https://esigncomply.com/signup) · [Read the docs](https://esigncomply.com/docs/quickstart/render)

Free plan: 10 live signatures a month and a full test mode. No card required.

Render is a trademark of its owner. Esign Comply is not affiliated with it. What this page says about Render is from Render's documentation or from a test run, as marked, on November 25, 2026. `/render.md` is this page as Markdown.

---

Every page on esigncomply.com has a Markdown version at the same URL plus `.md` (the home page is `https://esigncomply.com/index.md`). https://esigncomply.com/llms.txt lists them.

---

Esign Comply is the e-signature API and clickwrap API for developers who build their own signing flow in their own UI: it supplies the ceremony rules as a generated prompt for AI coding tools, records events in direct browser ceremonies, and seals independent, verifiable evidence.
