Agent prompts

Paste one of these into Cursor, Claude Code, Copilot, Bolt, Lovable, or v0. Replace the public key with yours (dashboard -> API keys).

Next.js (App Router)

text
Integrate OneTrial trial-abuse prevention into this Next.js (App Router) project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Express

text
Integrate OneTrial trial-abuse prevention into this Express project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Django

text
Integrate OneTrial trial-abuse prevention into this Django project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Rails

text
Integrate OneTrial trial-abuse prevention into this Rails project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Laravel

text
Integrate OneTrial trial-abuse prevention into this Laravel project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Supabase Auth

text
Integrate OneTrial trial-abuse prevention into this Supabase Auth project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Clerk

text
Integrate OneTrial trial-abuse prevention into this Clerk project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Auth0

text
Integrate OneTrial trial-abuse prevention into this Auth0 project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

Firebase Auth

text
Integrate OneTrial trial-abuse prevention into this Firebase Auth project.
Facts:
- Public key (browser snippet): ot_pk_... (from the dashboard, API keys page)
- Secret key: read from env ONETRIAL_API_KEY (server only; never ship it to the browser)
- Reference: https://onetrial.dev/llms-full.txt (fetch it first)
Do, in order:
1. Add <script src="https://onetrial.dev/v1.js" data-key="YOUR_PUBLIC_KEY" async></script> to the signup page.
2. On submit, call `await OneTrial.getToken()` and send it with the form as visitorToken.
3. In the server-side signup handler, POST https://onetrial.dev/api/v1/decisions with { visitorToken, email, ip, userId } and Authorization: Bearer $ONETRIAL_API_KEY. Branch on decision: allow -> create trial; challenge -> redirect to challengeUrl and unlock the trial on the challenge.completed webhook; deny -> show a paid plan / support link. Never expose score or reasons to the visitor.
4. Register a webhook endpoint (POST https://onetrial.dev/api/v1/webhooks) and verify OneTrial-Signature.
5. Confirm with GET https://onetrial.dev/api/v1/integration/status until snippet, first_decision and webhook are done. Do not report success until that call says so.

MCP server

json
{ "mcpServers": { "onetrial": { "command": "npx", "args": ["-y", "@onetrial/mcp"], "env": { "ONETRIAL_API_KEY": "ot_test_...", "ONETRIAL_BASE_URL": "https://onetrial.dev" } } } }
Tools: create_test_api_key, get_integration_guide(framework), verify_integration, query_decisions, update_thresholds. Without a key, the server runs device authorization and prints a code to approve at https://onetrial.dev/device.

One-command install

bash
npx onetrial init
Detects Next.js / Express / Django / Rails, authorizes via a device code, writes .env, injects the snippet and a server example, runs a self-test signup, and prints the integration checklist. Idempotent; safe in CI with ONETRIAL_API_KEY set.