Set up a test integration from an empty project
To set up a test integration from an empty project, your person signs up once and creates an agent token. With the token you read the account, create a test key, register a sample document, create a profile and one session on Esign Comply, then run the conformance check. Test mode needs no domain and no card.
Paste the prompt into your AI agent, or follow the steps yourself. The whole flow is in the guide for AI agents.
Last updated
Set up an Esign Comply test integration in this project, from an empty project to one sealed test record. Read these first and follow them exactly: - https://esigncomply.com/agents/set-up-test-integration.md (this task, step by step) - https://esigncomply.com/agents.md (every dashboard label and every account call) - https://esigncomply.com/setup.md (the whole setup runbook) What stays with me: I create the account at https://esigncomply.com/signup?next=/dashboard/agent, accept the terms and type the 6-digit code from my inbox. Then I press "Create agent token" on the page "Agent access" and paste you the block it shows. Never tick the acceptance box or type the code for me. What you do: 1. Keep the agent token in ESIGNCOMPLY_AGENT_TOKEN. Call GET /v1/agent and store api_url as ESIGNCOMPLY_API_URL. 2. Create a test key with POST /v1/agent/api-keys and store it as ESIGNCOMPLY_API_KEY in .env.local, listed in .gitignore. Never print a token or a key. 3. Check the key with GET /v1/usage. 4. Register one sample document with "Sample" in its name, publish one version, and create a profile with the checkbox method at L1. 5. Build one sign-up page: the server creates the session, the browser SDK records the ceremony, and the server confirms the record before it creates the account. 6. Run npx esigncomply check --url <page> and fix every finding marked "block". Report to me: the files you changed, the IDs you created, the conformance summary, and where the key is stored (the variable name, never the value). When the check passes, add the block at https://esigncomply.com/rules.md to this project's instruction file.
20 lines. Scroll inside the panel to read it, or copy the whole prompt with the button above.
What do you need before you set up a test integration?
- A person who can create the account. The Free plan needs no card.
- A project that runs on
localhost. Test keys work onlocalhost,127.0.0.1and listed preview hosts before any domain is verified. - Node.js 20.19 or later, for the CLI.
- A place for secrets on the server:
.env.local, listed in.gitignore, for development. - The two packages of the integration:
npm install esigncomply @esigncomply/browser.
How do you set up a test integration with Esign Comply, step by step?
- 01
Give your person the sign-up link
Your person creates the account. You never tick the acceptance box and you never type the code for them. They fill the field "Email", tick the one checkbox, press "Create account", then on the page "Check your email" they type the 6-digit code from their inbox into the field "Code" and press "Continue". The browser opens
https:/with the heading "Agent access". No card is asked for./esigncomply.com /dashboard /agent The link to give themhttps://esigncomply.com/signup?next=/dashboard/agent
- 02
Get an agent token
On "Agent access" the field "Name" is filled with "My AI agent" and the field "Expires after" offers "1 day", "7 days", "30 days" (selected) and "90 days". Driving your person's logged-in browser, press "Create agent token" and read the token from the block headed "Agent token “My AI agent”". Otherwise your person presses the button and pastes you the block headed "Paste this to your AI agent". The token starts with
esc_agent_, is 53 characters long and is shown once. Keep it inESIGNCOMPLY_AGENT_TOKEN, never in client code, a URL, a log line or git. - 03
Read the account and store the API address
A
200with"object": "agent_account"means the token works. Takeapi_urlfrom the answer and store it on the server asESIGNCOMPLY_API_URL: the Node SDK and the CLI read that variable.next_stepnames the open step, with its API call inapiand its dashboard page inbrowser. On a new account it iscreate_test_key.curl -s https://esigncomply.com/v1/agent \ -H "Authorization: Bearer $ESIGNCOMPLY_AGENT_TOKEN"
- 04
Create a test key
In a browser:
https:/, on the page headed "Get started" press "Create test key", read the line/esigncomply.com /dashboard ESIGNCOMPLY_API_KEY=esc_test_…and press "I have saved the key". Without a browser, make the call below. The answer is a201that carries the key once, in the fieldkey, with the permissionfull_access. Store it on the server only, asESIGNCOMPLY_API_KEYin.env.local, and check that.env.localis listed in.gitignore. Never give the variable a public prefix such asNEXT_PUBLIC_orVITE_.Without a browsercurl -s -X POST https://esigncomply.com/v1/agent/api-keys \ -H "Authorization: Bearer $ESIGNCOMPLY_AGENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "mode": "test" }' - 05
Make the first API call
A
200with"object": "usage"means the key works.401 invalid_api_key: the variable is empty or holds another value.421 region_mismatch: use thehostnamed in the error. Check thattest_events.used_this_monthis belowtest_events.quota_per_month, which is 500 on the Free plan. Never echo the key: to say which key is in use, name its prefix only.curl -s "$ESIGNCOMPLY_API_URL/usage" \ -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY"
- 06
Register a sample document and publish one version
Use the documents the project has. An empty project has none, so register a short sample document, put "Sample" in its name, and say so in your report. In a browser:
https:/, link "New document", field "Name", group "Type", button "Create document", then under "Publish a version" the fields "Version label", "Language", "Format" and "Content" and the button "Publish version". Without a browser, make the two calls below and put the/esigncomply.com /dashboard /documents idof the first answer in place ofdoc_8Hq2. Both answer201. A published version cannot be edited: for new text, publish a new version label.Without a browsercurl -s "$ESIGNCOMPLY_API_URL/documents" \ -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" -H "Content-Type: application/json" \ -d '{ "name": "Sample Terms of Service", "type": "terms" }' curl -s "$ESIGNCOMPLY_API_URL/documents/doc_8Hq2/versions" \ -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" -H "Content-Type: application/json" \ -d '{ "version_label": "2026-11-23", "language": "en", "content": { "format": "markdown", "text": "# Sample Terms of Service\n\nSample text for a test integration." } }' - 07
Create a profile
A profile says how one kind of signing works: the method, the assurance level and the rule packs. Ask your person which jurisdictions apply. In a browser:
https:/, link "New profile", field "Name", field "Signature method" set to "Checkbox plus button (checkbox)", field "Assurance level" set to "L1 Recorded", group "Enabled packs" with "US-FED United States, Federal" ticked, button "Create profile". The profile ID (/esigncomply.com /dashboard /profiles prof_…) is in the address of the page that opens, and in the fieldidof the API answer.Without a browsercurl -s "$ESIGNCOMPLY_API_URL/profiles" \ -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" -H "Content-Type: application/json" \ -d '{ "name": "Signup", "jurisdictions": ["US-FED"], "method": "checkbox", "assurance_level": "L1" }' - 08
Create one session and run the ceremony
Your server creates the session with the key and sends only
client_tokenanddocumentsto the browser. The answer listsrequired_steps. For the profile of step 7 they areclient.attached, onedocument.presented:<version_id>for each version,notice.captured,intent.capturedandsignature.applied. Read them from the session and never hard-code them. In the page,EsignComply.attach({ clientToken })from@esigncomply/browserstarts the ceremony,presentDocumentreports each version,observeAssent({ region, checkbox, submit })watches the box and the button, andcomplete()runs from the user's real click. Before the app creates the account, the server reads the record withGET /v1and requires a/records /{id} statusofrecorded,timestampedoranchored.On the servercurl -s "$ESIGNCOMPLY_API_URL/sessions" \ -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: signup-user_7c1d-1" \ -d '{ "profile": "prof_signup_4f1a", "signer": { "external_id": "user_7c1d", "email": "dana@example.org", "class": "consumer", "country": "US", "region": "US-CA" }, "documents": [{ "document": "doc_8Hq2", "version": "current" }], "context": { "url": "http://localhost:3000/signup", "purpose": "account_signup" } }' - 09
Run the conformance check
The check opens your page at three window sizes, 390 by 844, 768 by 1024 and 1440 by 900, and reads the test ceremony it records at each. Fix every finding marked
blockand list every finding markedwarnin your report. Each finding names its rule (CR-01toCR-28), the measurement and a fix. The command takes a test key only. It exits with0when no finding blocks, and with1when one does, when a violation it tried was not refused or when a ceremony did not complete. The findings are also athttps:/, where the button "Copy for AI" copies them as Markdown./esigncomply.com /dashboard /conformance In the projectnpx esigncomply check --url http://localhost:3000/signup
It worked when
GET /v1 reports onboarding.key_created and onboarding.first_test_record as true, the record is in the table at https:/, and the check exits with 0.
What must a person do, and what must the agent never do?
The account belongs to a person. These limits hold in this task, as they do in every task an agent runs on Esign Comply.
The person does
- Your person creates the account: the email, the acceptance of the terms, and the 6-digit code from their inbox.
- Your person creates the agent token on the page "Agent access". You can revoke your own.
- Your person chooses which jurisdictions apply. The choice of packs is theirs.
- Your person supplies the text of their own legal documents. Until they do, the project runs on the sample document.
The agent never does
- Never tick the acceptance box or type the emailed code for your person.
- Never put the agent token or a key in client code, a URL, a log or git.
- Never write or change the text of a legal document. A sample document says "Sample" in its name.
- Never pre-check an assent control, auto-submit, or call
.click()on the user's behalf. - Never use a live key in development. Development and previews use test keys.
Questions about this task: set up a test integration
Does a test integration need a verified domain?
No. Test keys work on localhost, 127.0.0.1 and listed preview hosts before any domain is verified. A verified domain is needed for a live key only.
Does the agent need a browser to set up a test integration?
No. With the agent token, GET /v1/agent reads the account and POST /v1/agent/api-keys issues the test key, and the normal API does the rest with that key. The same steps exist in the dashboard, which the agent opens at /agent-login with the same token.
What can the test key the agent creates do?
Everything in test mode. It has the full_access permission, like the key the dashboard creates on Get started, so it covers documents, profiles, sessions, records and the conformance check. It starts with esc_test_us_ or esc_test_eu_ and is shown once.
How long do test records stay?
Test records are deleted 30 days after they are created. They are sealed on a separate test ledger, watermarked TEST, and never count against the plan's live signatures.
What if the project has no terms to register yet?
Register a short sample document and put Sample in its name. Say so in your report, so that your person replaces it with their own text before going live. The agent never writes legal text.
Which packages does a test integration install?
Two: esigncomply for the server and the CLI, and @esigncomply/browser for the page. A React project can add @esigncomply/react. The fourth package, esigncomply-verify, checks evidence offline and is not part of the integration.
What does the agent report when the test integration is done?
The files it created or changed, the IDs of the document, the version and the profile, and the conformance summary. It names the variables that hold the token and the key, never their values. It also says what is left for the person.
Your person signs up once. You do the rest.
Free plan: 10 live signatures a month and a full test mode. No card required.