AskBadge Docs
Get your widget live in 60 seconds. Everything you need is below.
Quickstart
1. Create an account and add your site from the dashboard.
2. Verify your domain (DNS TXT record or meta tag — takes 30 seconds).
3. Copy your embed code and paste it before the closing </body> tag.
That's it. The widget is live.
Embed code
Add this single script tag to your site. Replace YOUR_SITE_KEY with your site's key from the dashboard:
<!-- AskBadge Widget --> <script src="https://askbadge.com/widget.js" data-key="YOUR_SITE_KEY" async ></script>
The async attribute means it won't block page rendering. The script is ~8KB gzipped.
Your site must be verified before the widget renders. Unverified sites return 404 from the widget API, and the script exits silently.
Domain verification
Verification proves you own the domain. Choose either method:
Option A — DNS TXT record
Add a TXT record to your domain:
Type: TXT Name: @ (or your domain) Value: askbadge-verify=YOUR_TOKEN
DNS changes may take up to 48 hours to propagate, but usually under 5 minutes.
Option B — HTML meta tag
Add this tag inside your <head>:
<meta name="askbadge-verify" content="YOUR_TOKEN" />
Your verification token is shown on the site's verification page in the dashboard. Click "Check verification" after adding the record/tag.
AI platforms
AskBadge supports five AI platforms. Each click opens the platform in a new tab with your prompt.
| Platform | URL pattern |
|---|---|
| Claude | https://claude.ai/new?q={prompt} |
| ChatGPT | https://chat.openai.com/?q={prompt} |
| Gemini | (clipboard fallback) |
| Grok | https://x.com/i/grok?text={prompt} |
| Perplexity | https://www.perplexity.ai/search/new?q={prompt} |
Gemini doesn't support URL-based prompts — clicking Gemini copies your prompt to clipboard and opens gemini.google.com. The widget shows a "Prompt copied!" tooltip.
Prompt variables
Use these variables in your custom prompt. They're replaced at runtime with your site's actual values:
| Variable | Replaced with |
|---|---|
| {siteName} | Your site's display name |
| {siteUrl} | https://yourdomain.com |
Default prompt if none set:
Tell me about {siteUrl}. What does it do, who is it for, and would you recommend it?MCP server
Agency API keys also work with the AskBadge MCP server, so Claude Desktop, Cursor, and other MCP clients can read your sites, analytics, loop data, and widget config directly.
The MCP package is read-only and runs locally over stdio. It does not create sites or complete checkout and verification flows for you.
Setup instructions, config snippets, and the full tool list live in /docs/api.
{
"mcpServers": {
"askbadge": {
"command": "npx",
"args": ["-y", "askbadge-mcp"],
"env": {
"ASKBADGE_API_KEY": "sk_live_your_key_here"
}
}
}
}API reference
API access is available on the Agency plan.
Full Agency API documentation lives at /docs/api.
Public endpoints (no auth)
GET /api/widget/[key] — Widget configuration. Cached 60s.
POST /api/track — Click event tracking. Rate limited.
Protected endpoints (session required)
GET /api/sites — List sites
POST /api/sites — Create site
GET /api/sites/[id] — Site detail
PATCH /api/sites/[id] — Update site/widget config
DELETE /api/sites/[id] — Delete site
POST /api/sites/[id]/verify — Trigger verification
Something missing? Email us and we'll help.