Skip to content
Coding agent · GitHub Copilot

Add e-signatures with GitHub Copilot

You already write code with GitHub Copilot in your editor. Give it one prompt and it adds e-signatures to the app you have: your form, your button, the rules from Esign Comply and an independent record of each acceptance.

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

One prompt, from paste to record
  1. 01
    Put a test key in your server environmentYou
  2. 02
    Paste one prompt into GitHub CopilotYou
  3. 03
    GitHub Copilot wires your form and your serverYou
  4. 04
    Acceptance reported from the user's browserEsign Comply
  5. 05
    Sealed record, receipt and timestampEsign Comply
  6. 06
    Server confirms, then creates the accountYou
Copy-paste prompt

The prompt to paste into GitHub Copilot

Open Copilot chat in your editor, with your repository open, and paste this. 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 GitHub Copilot
  • 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
Prompt for GitHub Copilot
Add Esign Comply to this repository's signup flow. The user ticks our own checkbox and clicks our own Create account button to accept the Terms of Service and the Privacy Notice. Esign Comply keeps the independent record of that acceptance.

Read these before writing code, and follow them exactly:
- https://esigncomply.com/setup.md
- https://esigncomply.com/auth.md
- https://esigncomply.com/llms.txt

Implement
1. A server endpoint that creates the session with the secret key from ESIGNCOMPLY_API_KEY and sends the browser only the client token and the document version IDs.
2. The browser side, inside the signup form that already exists: attach @esigncomply/browser with the client token, observe the unchecked checkbox and the button, and call complete() from the user's real click.
3. A server check that confirms the record before the account is created: it reads the record with the secret key and compares status, livemode, signer ID and version IDs with what the server saved.

Never invent API methods, packages or legal wording. Never pre-check the box. Never put the secret key in client code or in a committed file. If the docs do not cover a step, or it conflicts with existing code, stop and ask me.

Run commands in the editor's terminal in agent mode, or list them for me to run, including npx esigncomply check --url http://localhost:3000/signup. Save these rules in .github/copilot-instructions.md.
5 steps

How to run it in GitHub Copilot

GitHub Copilot is GitHub's AI coding assistant. This is the whole run, from a new Esign Comply account to your first test record.

  1. 01
    Create a free account and a test keySign 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. 02
    Put the key in .env.localAdd ESIGNCOMPLY_API_KEY=esc_test_us_... and keep the file out of version control. The prompt tells Copilot never to put the key in client code or in a committed file.
  3. 03
    Paste the prompt into Copilot chatThe prompt tells Copilot to run commands in the editor's terminal in agent mode, or to list them for you to run. Either way it writes the same three parts: the session endpoint, the form wiring and the server check.
  4. 04
    Run the app and tick the boxStart your dev server, open /signup, tick the checkbox and click Create account. Test keys work on localhost with no setup.
  5. 05
    Keep the rules in the repoThe prompt saves them in .github/copilot-instructions.md. Commit that file and everyone on the repository builds signing screens under the same rules.
The 60-second result

What you have 60 seconds after GitHub Copilot finishes

One prompt, one signup on localhost. This is what Copilot adds to your repository, and what shows up in your Esign Comply dashboard.

  1. 01

    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. 02

    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. 03

    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.

// 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,
  });
}

The example is a Next.js repository. In another stack, GitHub Copilot writes the same three parts under that stack's file names.

The record that appears

One sealed test record, kept by Esign Comply

Recordrec_Z4m8
simple · L1
RecordedWritten durably, receipt signed with ES256
TimestampedExternal RFC 3161 token over the record hash
AnchoredPublic anchor pending
Checkbox changed by a trusted user eventobserved
Terms of Service, version dv_3kT9observed
Server time 2026-11-21T15:03:20.291Zobserved
Signer email dana@example.orgasserted
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.

What GitHub Copilot gets right with the rules, and wrong without them

Ask for a signup form with terms and you get the familiar pattern: a one-line notice and a quiet link. The prompt gives Copilot the rules to build to instead, and the check measures the result.

CR-01block

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-02block

Notice text names every document

Without the rules

One generic line, "By signing up, you agree to our terms", with no document titles and no links.

With the prompt

The notice carries the registered title of every document in the session, each one linked, inside the same container as the checkbox and the button.

CR-04block

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-05warn

Document link contrast

Without the rules

Links to the terms styled to match the sentence around them, because it looked cleaner.

With the prompt

Document links are underlined and differ in colour from the surrounding text by at least 3 to 1. The check prints the ratio it measured.

CR-07warn

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.

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.

Go further with GitHub Copilot

The instructions file travels with the repository. Ask Copilot for the next flow and it starts from the same rules.

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
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
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
Prompt generator

The exact rules for your regions

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

Generate a prompt

Questions about GitHub Copilot and e-signatures

Can GitHub Copilot add e-signatures to my app?

Yes. Paste the prompt on this page into Copilot chat with your repository open. It reads the Esign Comply docs, creates the session on your server, attaches the browser SDK to your existing checkbox and button, and confirms the record on your server before the account is created.

Does the prompt work with Copilot's agent mode?

Yes. The prompt tells Copilot to run commands in the editor's terminal in agent mode, and to list them for you to run otherwise. Either way the result is the same three parts: a session endpoint, your form with the SDK attached, and a server check of the record.

Where do the Esign Comply rules go in a Copilot project?

In .github/copilot-instructions.md. The prompt tells Copilot to save them there. Commit the file and the rules apply to every later request in that repository, for you and for everyone else who works in it.

Where do I put the API key?

In your server environment as ESIGNCOMPLY_API_KEY, for example in .env.local, which stays out of version control. In CI and on your host, use the platform's secret settings. The browser never sees the key: it receives a short-lived client token for one session.

Read the quickstart

Is there a generated prompt for GitHub Copilot?

Yes. GitHub Copilot is one of the tools in the prompt generator. Pick your use case, your regions, your signer types and your stack, choose GitHub Copilot, and you get one prompt with your own document and profile IDs in it.

See the prompt generator

Give Copilot the rules. Leave the record to us.

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

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

Working with an AI tool? This page is also available as Markdown: /build/github-copilot.md