# Ask Grokbot how to add e-signatures to your app

> Ask Grokbot how to add e-signatures to your app. One prompt returns the Esign Comply integration as three files, and a second writes an engineering brief.

Source: https://esigncomply.com/build/grokbot

Chat assistant · Grokbot

You're researching how to add e-signatures to your app, and you're asking Grokbot. Paste this prompt and the answer is the Esign Comply integration: how it works, then a signup clickwrap for your stack as three files you add to your project.

[Get started](https://esigncomply.com/signup) · [Generate a prompt](https://esigncomply.com/product/prompt-generator)

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

One prompt, from paste to record

1. Paste the prompt into Grokbot · You
2. Add the three files to your project · You
3. Put a test key in your server environment · You
4. Acceptance reported from the user's browser · Esign Comply
5. Sealed record, receipt and timestamp · Esign Comply
6. Server confirms, then creates the account · You

Copy-paste prompt

## The prompt to paste into Grokbot

Fill in the square brackets, then paste this into a new chat with Grokbot. It builds a signup clickwrap: your Terms of Service and Privacy Notice, accepted with your own checkbox and your own button.

What the prompt tells Grokbot

- Read `setup.md`, `auth.md` and `llms.txt` before writing anything.
- Create the session on your server with the secret key, and send only the client token to the browser.
- Attach the browser SDK to your own checkbox and button. No widget, no iframe.
- Confirm the record on your server before the account exists.
- Never invent an API method, and stop and ask when something conflicts.

[Generate the prompt for your regions](https://esigncomply.com/product/prompt-generator)

Prompt for Grokbot

```
I am researching how to add e-signatures to my app. My app: [what it does, who signs what]. My stack: [framework, database, host]. Answer with the Esign Comply integration, starting with a signup clickwrap: new users accept my Terms of Service and Privacy Notice with a checkbox and a button that I render myself.

Sources first. Read these pages and work only from them:
- https://esigncomply.com/setup.md
- https://esigncomply.com/auth.md
- https://esigncomply.com/llms.txt
If one does not open, name it and stop. Do not fill the gap from memory.

Part 1, how it works: the sequence from session to sealed record in five lines, with what runs on my server and what runs in the browser.

Part 2, the code: three complete files for my stack, each with its path.
1. Server: create the session with the secret key from ESIGNCOMPLY_API_KEY. Send the browser only the client token and the document version IDs.
2. Browser: my signup form with @esigncomply/browser attached to my own unchecked checkbox and my own Create account button. complete() runs from the user's real click.
3. Server: confirm the record with the secret key before the account is created.

Rules
- Never invent API methods, packages or legal wording. Cite the docs page for each call.
- Never pre-check the box or submit for the user.
- Never ask for my key in this chat. Name the environment variable.
- If the docs do not cover something, or it conflicts with my stack, stop and ask me.
```

5 steps

## How to run it in Grokbot

Grokbot is an AI assistant that can code and, more importantly, is used when researching engineering questions. This is the whole run, from a new Esign Comply account to your first test record.

1. **Create a free account and a test key**

   Sign up, then choose Create test key in the dashboard. The key starts with `esc_test_` and is shown once. The Free plan asks for no card, and a test key works on `localhost` with no domain.

2. **Ask Grokbot the question**

   Describe your app and your stack between the square brackets and paste the prompt. The answer comes in two parts: how the integration works, from session to sealed record, then three files with their paths. If Grokbot names a page it could not open, paste that page's text into the chat: all three are plain text.

3. **Check part 1 against the docs**

   Research is useful when you can check it. Every call in the answer carries its docs page, so open one or two and compare them before you copy any code.

4. **Move the files into your project**

   Copy each file to its path, install `esigncomply` and `@esigncomply/browser`, and set `ESIGNCOMPLY_API_KEY` in your server environment yourself. The key stays out of the chat.

5. **Run it, then bring the findings back**

   Open your signup page on `localhost`, tick the checkbox and click Create account. Then run `npx esigncomply check --url http://localhost:3000/signup` and paste any finding into the same chat, so Grokbot corrects the file it wrote.

[Create a free account](https://esigncomply.com/signup) · [Read the quickstart](https://esigncomply.com/docs/quickstart)

Research prompt

## A second prompt, for research with Grokbot

Not ready for code? This second prompt asks Grokbot for an engineering brief: what a signing flow has to record, the ways to get one, and the Esign Comply request sequence from the docs.

The comparison is yours to read and argue with. The integration part comes from the docs, so every call Grokbot shows is one you can look up.

[See what you can build yourself](https://esigncomply.com/build)

Research prompt for Grokbot

```
Write me a short engineering brief on adding e-signatures to an app I build myself. My app: [what it does, who signs what]. My stack: [framework and host].

Cover, in this order:
1. What a signing flow has to record: what the signer was shown, what they did, and when.
2. The ways to get one: buy a hosted signing product, embed a vendor's signing screen, self-host an open-source tool, or build the screens in my own UI with Esign Comply as the independent record keeper. For each: who builds the screen, who holds the record, and what I maintain.
3. The Esign Comply request sequence for my stack, from https://esigncomply.com/setup.md and https://esigncomply.com/llms.txt: each call in order, where it runs, and the docs page it comes from.
4. What to test before going live, from the same docs.

Mark every statement that does not come from those two pages as your own view. Do not invent API methods.
```

The 60-second result

## What you have 60 seconds after Grokbot finishes

Add the three files, start the app and sign up once. This is the code from Grokbot's answer, and the record Esign Comply holds after that first test signup.

1. **The server route that creates the session**

   e.g. `app/api/ceremony/route.ts`

   It holds the secret key, pins the current version of each document and hands the browser a short-lived client token.

2. **Your signup form, with the SDK attached**

   e.g. `app/signup/signup-form.tsx`

   Your markup and your styles. The SDK renders nothing: it watches your links, your checkbox and your button, and reports what the user did.

3. **The server confirmation**

   e.g. `app/api/signup/confirm/route.ts`

   The record ID came from the browser, so the server reads the record with the secret key before the account exists.

**Create the session**

```ts
// app/api/ceremony/route.ts
import { esc } from "@/lib/esigncomply";

export async function POST(request: Request) {
  const { signerId, email, attempt } = await request.json();

  const { data: session, error } = await esc.sessions.create(
    {
      profile: "prof_signup_4f1a",
      signer: {
        external_id: signerId,
        email,
        class: "consumer",
        country: "US",
      },
      documents: [
        { document: "doc_8Hq2", version: "current" }, // Terms of Service
        { document: "doc_Pv71", version: "current" }, // Privacy Notice
      ],
      context: {
        url: "http://localhost:3000/signup",
        locale: "en-US",
        purpose: "account_signup",
      },
    },
    { idempotencyKey: `signup-${signerId}-${attempt}` },
  );
  if (error) return Response.json({ error: error.code }, { status: 502 });

  // Save signerId and the pinned version IDs in server-owned state.
  return Response.json({
    clientToken: session.client_token,
    documents: session.documents,
  });
}
```

**Signup form**

```tsx
// app/signup/signup-form.tsx
import { EsignComply } from "@esigncomply/browser";

// After /api/ceremony returns clientToken and documents:
const ceremony = await EsignComply.attach({ clientToken });

await ceremony.presentDocument({
  versionId: documents[0].version_id,
  mode: "hyperlink",
  link: document.querySelector("#tos-link"),
});
await ceremony.presentDocument({
  versionId: documents[1].version_id,
  mode: "hyperlink",
  link: document.querySelector("#privacy-link"),
});

await ceremony.observeAssent({
  region: document.querySelector("#assent"), // notice, links, box, button
  checkbox: document.querySelector("#agree"), // yours, unchecked
  submit: document.querySelector("#create-account"), // your button
});

// Called from the real submit handler, after the user ticked the box.
async function finishSignup() {
  const result = await ceremony.complete();
  // result: { recordId, receipt, verifyUrl, status }
  await fetch("/api/signup/confirm", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ recordId: result.recordId }),
  });
}
```

**Confirm on the server**

```ts
// app/api/signup/confirm/route.ts
import { esc } from "@/lib/esigncomply";

export async function POST(request: Request) {
  const { recordId } = await request.json();
  const expected = await loadCeremonyState(request); // server-owned state

  const { data: record, error } = await esc.records.get(recordId);
  if (error) return Response.json({ confirmed: false }, { status: 409 });

  const versions = record.documents.map((d) => d.version_id).sort();
  const confirmed =
    ["recorded", "timestamped", "anchored"].includes(record.status) &&
    record.livemode === (process.env.VERCEL_ENV === "production") &&
    record.signer.external_id === expected.signerId &&
    versions.join() === [...expected.versionIds].sort().join();

  if (!confirmed) return Response.json({ confirmed: false }, { status: 409 });
  // Only now create the account.
  return Response.json({ confirmed: true });
}
```

The example is for Next.js. Name your stack in the prompt and Grokbot writes the same three files for it.

The record that appears

### One sealed test record, kept by Esign Comply

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

Your first test record opens in the dashboard with what was observed, what was asserted, and the conformance findings. It is sealed like a live record, on a separate test ledger, and its evidence report is watermarked TEST.

[Sign a live demo](https://esigncomply.com/use-cases) · [What a record holds](https://esigncomply.com/product/evidence)

## What Grokbot gets right with the rules, and wrong without them

A research answer explains a signing flow well and leaves out what the screen is measured on. The prompt ties Grokbot to the docs, where each of those measurements is a numbered rule.

[CR-01](https://esigncomply.com/docs/conformance#cr-01) · block

### Affirmative assent control

Without the rules

The checkbox ships already ticked, or a handler ticks it for the user to save a click.

With the prompt

The box renders unchecked and only a real user event changes it. The SDK records its state at load, and the check reports a pre-checked box or a scripted click at block level.

[CR-04](https://esigncomply.com/docs/conformance#cr-04) · block

### Notice and control in the same viewport

Without the rules

The agreement line sits in the footer or under a long form, below the fold on a phone.

With the prompt

The notice sits directly above the button in the same container. The SDK records both positions at the signing act, and the check runs your page at 390 by 844.

[CR-06](https://esigncomply.com/docs/conformance#cr-06) · warn

### Notice font size and contrast

Without the rules

Fine print: 10 px, light gray, tucked under a bright button.

With the prompt

The notice is set at body size, never under 12 px, with contrast of at least 4.5 to 1 against its background. The SDK measures both.

[CR-07](https://esigncomply.com/docs/conformance#cr-07) · warn

### Single primary action control

Without the rules

Email signup and two social sign-in buttons in one form, all styled as the main action under one notice.

With the prompt

One primary button inside the assent container. Social sign-in gets its own container, its own notice and its own session.

[CR-08](https://esigncomply.com/docs/conformance#cr-08) · block

### Document links resolve to the registered version

Without the rules

A link to `/terms` that serves whatever is in the repo today, or the legal text pasted into a component.

With the prompt

Every link serves the registered version by its ID, and the record pins that version by SHA-256 hash. Document text is never copied into your code.

Each row is a real conformance rule with its ID and its default level. Esign Comply runs 28 of them over your test records, and every finding names the rule, the measurement and the fix.

[E-signature mistakes AI tools make](https://esigncomply.com/learn/vibe-coded-esignature-mistakes) · [All 28 conformance rules](https://esigncomply.com/docs/conformance)

## Go further with Grokbot

One research question answered, one flow running. These pages take you from a signup checkbox to a whole signing product.

A whole product

### Build your own signing app

Upload a document, email each signer a link to your own application and collect the signatures there. There are 7 build guides, each with the steps and the code.

[Build your own DocuSign](https://esigncomply.com/build/docusign-alternative)

Your stack

### Stack guides

The same integration written out for your framework and your host, with working code for the server, the browser and the confirmation.

[Browse the stack guides](https://esigncomply.com/guides)

Live demos

### Use cases

NDAs, contractor agreements, consent forms, order forms and terms updates. Each page has a live demo you can sign in test mode.

[See the use cases](https://esigncomply.com/use-cases)

Prompt generator

### The exact rules for your regions

Pick your use case, regions, signer types and stack. You get one prompt to paste into Grokbot, with your own document and profile IDs and the rule packs you selected.

[Generate a prompt](https://esigncomply.com/product/prompt-generator)

### Build guides to follow with Grokbot

- [Build your own DocuSign](https://esigncomply.com/build/docusign-alternative)
- [Build your own Dropbox Sign](https://esigncomply.com/build/dropbox-sign-alternative)
- [Build your own PandaDoc](https://esigncomply.com/build/pandadoc-alternative)
- [Build your own Adobe Acrobat Sign](https://esigncomply.com/build/adobe-sign-alternative)
- [Build your own signNow](https://esigncomply.com/build/signnow-alternative)
- [Build your own DocSend](https://esigncomply.com/build/docsend-alternative)
- [Build your own clickwrap](https://esigncomply.com/build/clickwrap)
- [All build guides](https://esigncomply.com/build)

### The same prompt for another AI tool

- [Cursor](https://esigncomply.com/build/cursor)
- [Claude Code](https://esigncomply.com/build/claude-code)
- [Codex](https://esigncomply.com/build/codex)
- [Windsurf](https://esigncomply.com/build/windsurf)
- [GitHub Copilot](https://esigncomply.com/build/github-copilot)
- [Devin](https://esigncomply.com/build/devin)
- [Lovable](https://esigncomply.com/build/lovable)
- [v0](https://esigncomply.com/build/v0)
- [Bolt](https://esigncomply.com/build/bolt)
- [Replit](https://esigncomply.com/build/replit)
- [ChatGPT](https://esigncomply.com/build/chatgpt)
- [Grok](https://esigncomply.com/build/grok)
- [Muse](https://esigncomply.com/build/muse)
- [All AI tools](https://esigncomply.com/build#tools)

## Questions about Grokbot and e-signatures

### Can I ask Grokbot how to add e-signatures to my app?

Yes. Paste the prompt on this page with your app and stack filled in. Grokbot answers with the Esign Comply integration in two parts: how it works, from session to sealed record, and three files for a signup clickwrap, with the docs page behind each call. You copy the files into your project.

### What does the engineering brief prompt return?

A short brief in four parts: what a signing flow has to record, the ways to get one with who builds the screen and who holds the record in each, the Esign Comply request sequence for your stack with the docs page for every call, and what to test before going live.

[E-signature APIs compared](https://esigncomply.com/compare/e-signature-apis)

### How do I check that Grokbot's answer is right?

Two ways. The prompt has Grokbot cite the docs page for each call, so you open the page and compare. Then you run the code: tick the box on your signup page with a test key and run npx esigncomply check --url http://localhost:3000/signup. Each finding carries the rule ID, the measurement and the fix.

[Read the conformance rules](https://esigncomply.com/docs/conformance)

### Does my API key go into the Grokbot chat?

No. Set it yourself in your server environment as ESIGNCOMPLY_API_KEY. The prompt tells Grokbot to name the variable and never to ask for the key. The files it writes read the variable on the server, and the browser receives a short-lived client token for one session.

[How to handle the key](https://esigncomply.com/docs/guides/ai-builders)

### What can I build after the signup clickwrap?

Anything that needs a signature: NDAs, contractor agreements, order forms, consent forms and terms updates, up to a full send-for-signature app with uploads and signing links. The prompt generator writes the prompt for each one, with the rules for your regions and your stack.

[Use cases with live demos](https://esigncomply.com/use-cases)

## Ask Grokbot the question. Build the answer. Leave the record to us.

[Get started](https://esigncomply.com/signup) · [Documentation](https://esigncomply.com/docs)

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

Grokbot is a trademark of its owner. Esign Comply is not affiliated with it.

---

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.
