# DeskQ embed install task (for coding agents) You are installing the DeskQ support widget into this repository on behalf of a human builder. ## Inputs (human fills) - BOT_PUBLIC_KEY: pk________________ - EMBED_SCRIPT_URL: https://deskq.app/embed.js - (optional) FORM_SCRIPT_URL: https://deskq.app/form.js — only if they also want Form studio on the page - (optional) ALLOWED_ORIGINS to remind human to set in DeskQ dashboard: ________________ - (optional) POSITION: right | left (default right) - (optional) THEME: auto | deskq (default auto — matches host brand) ## Goal Add a single drop-in embed so user-facing pages show DeskQ chat (bottom-right by default). Do not rebuild chat UI. Do not add an npm dependency for DeskQ unless the host stack forces it. ## Exact chat snippet Optional attributes: - data-position="left" (only if POSITION=left) - data-theme="deskq" (only if THEME=deskq) - data-api-base only if the human explicitly asks (default: script origin) ## Optional form snippet ## Placement rules 1. Prefer the ROOT layout so ALL routes get the widget: - Next.js App Router: app/layout.tsx or src/app/layout.tsx — next/script strategy="afterInteractive" before - Next.js Pages Router: pages/_document.tsx or _app.tsx - Vite/React SPA: index.html before - Remix: app/root.tsx - Shopify Liquid: layout/theme.liquid before 2. Do NOT limit to only a marketing homepage if the product has app routes 3. Do NOT duplicate the script in many leaf pages if a root layout exists 4. If CSP exists, allow script-src and connect-src for https://deskq.app 5. Match the repo’s formatting; no drive-by refactors ## Checklist - [ ] Locate root layout / document - [ ] Inject snippet once with exact public key - [ ] Preserve data-bot-key (Next Script: client component or typed attrs if needed) - [ ] Note for human: Allowed Origins in DeskQ desk settings - [ ] Note for human: verify DESK control → test message → dashboard conversation ## Out of scope - Do not create the desk/account (human does that at https://deskq.app/sign-up unless key already provided) - Do not commit secrets; pk_ keys are public site keys only - Do not change auth, billing, or unrelated UI ## Multi-product note One pk_ key = one desk = usually one product. Additional products need additional desks (Growth/Pro). Promo VIBECODING is 30% off paid plans for life at Checkout. ## Done criteria 1. Code change in the host app’s root shell 2. Local or preview shows the DeskQ control 3. Short summary: files touched, how to re-test, CSP notes ## References - https://deskq.app/for-agents - https://deskq.app/agents.txt - https://deskq.app/llms.txt - https://deskq.app/pricing Proceed. Inspect the repo structure first, then make the minimal correct change.