# Junco: every guide in one file Junco's public guides, checked against what Junco does on 2026-11-25. Each starts with a comment saying where it lives. The index is https://juncodesk.app/llms.txt; the API as OpenAPI is https://desk.juncodesk.app/openapi.json. # What Junco is > **In short.** Junco is a support desk for game and app studios with an AI that answers first. > Users report a bug, suggest a feature or ask for help from a small form inside the product. The > AI replies in seconds from what the studio has taught it, sorts and groups every report, and > hands the team only what needs a person. When a fix ships, everyone who reported it is told, in > the same place they asked. Early access, invite only, no subscription; the AI is charged at cost > (about a cent or two a ticket). ## The problem it solves A small team with many users drowns in the same questions and the same bug, reported fifty ways, across email, Discord, store reviews and DMs. Junco puts one form inside the product, so reports arrive with the context a developer needs (version, screen, device, a screenshot, a save), and an AI deals with the repetitive part before anyone has to look. ## How it works 1. **A user reports something** from the form in your product: a website or web game (one script tag), a phone, console or desktop app (Junco's hosted page or a small HTTP API). They pick **Report a bug**, **Suggest a feature** or **Get help**, write a line or two, and can attach a screenshot, a save file and a log. They never make an account. 2. **The AI triages it** within seconds: it gives it a title, the area of the product, a severity and a confidence; spots whether it's the same problem as earlier reports and groups them; writes a reply from your product's knowledge; and decides whether a person is needed. 3. **The reply is checked** before the user sees it: by rules in code (no personal details, no links you haven't allowed, no promises) and by a second AI model with a checklist. A reply that fails waits for you. Money, accounts, bans, safety and reports about other users always go to a person, whatever the AI thinks. 4. **You get what needs you.** The desk's inbox shows tickets that need a person under **Needs you**, with the AI's notes. Urgent ones and surges ("5 people reported this in an hour") send a phone alert. 5. **You fix it.** With GitHub connected, one tap turns a group of reports into an issue, drafted by the AI without personal details. Closing the issue tells users the fix is coming. 6. **Users hear it's live.** When you release (a GitHub release, a button, or one line in your deploy script), every user who reported it is told, in the form where they asked. ## The words Junco uses | Word | Means | |---|---| | **Studio** | Your team's space in Junco. Credit, products and people belong to a studio. | | **Product** | Anything with its own support form: a game, an app, a website. Each has a **public key** `jk_...`. (The code and API say `game`; same thing.) | | **User** | Someone using your product who sends a ticket. They have no Junco account. (The API says `player`.) | | **Ticket** | One report: a **bug**, an **idea** or a **help** request, with its conversation. | | **Group** | Tickets about the same problem. The first one leads; resolving it resolves them all. | | **Knowledge** | What the AI knows about your product: plain Markdown you write or have drafted. It answers only from this. | | **The desk** | Junco's web app where your team works: inbox, tickets, products, alerts. Works on a phone. | | **Widget** | The script that draws the form inside a web page: `https://desk.juncodesk.app/widget/junco.js`. | | **Hosted page** | Junco's own support page for a product, `https://desk.juncodesk.app/s/`, for products that can't run the widget. | | **Signed user token** | A short-lived token your server signs so a signed-in user's tickets follow their account. Optional. | | **Credit** | Prepaid US dollars the AI spends, at cost. | | **Release** | Telling users their fix is live. | ## A ticket's stages | Stage (`stage` in the API) | On the desk | Means | |---|---|---| | `ai_handling` | AI handling | The AI answered and is looking after it. | | `needs_you` | Needs you | A person must act or decide. | | `waiting_on_player` | Waiting on user | Someone on your team asked the user something. | | `in_progress` | In progress | A GitHub issue is open for it. | | `awaiting_release` | Awaiting release | The issue was closed as completed; the user was told the fix is coming. | | `released` | Released | The fix is out and the user was told. Closed. | | `resolved` | Resolved | Done. Closed. A reply from the user reopens it. | ## Who it suits - **Small game and app teams** with lots of users and no support staff, who'd rather fix bugs than answer the same question all day. - **Web games and web apps** most of all: one script tag, screenshots and game state included. - **Teams on GitHub**, who want reports to become issues and users told when fixes ship. - **Products used by young people**: personal details are stripped before the AI reads anything, replies are checked for safety, and users can delete everything they've sent. ## What it doesn't do (yet) - **No email or chat channels.** Users write from the form or the hosted page, and read replies there. Junco doesn't send users email. - **No live chat** with typing agents; replies arrive in the form's thread. - **No native SDK packages.** Unity, Godot, mobile and desktop products use the hosted page or call the HTTP API (a few dozen lines; see [Apps, engines and desktop](/docs/platforms)). - **No open sign-up.** Early access is invite only: ask at the form on Junco's website. - **One region.** Data is stored on Junco's own servers in the United Kingdom. More in [Is Junco right for you?](/docs/compare) ## Where to go next - Setting up: [Getting started](/docs/getting-started). - Adding it to your code (or having your coding AI do it): [For coding AIs](/docs/for-ai-agents) and [Installing the form](/docs/install). - Money: [Pricing and AI credit](/docs/pricing). - Everything in one file, for AI tools: `/llms-full.txt`. --- # Getting started > **In short.** Ask for an invite, join with a passkey, add your product, install the form (paste a > prompt into your coding AI, paste a snippet, or turn on the hosted page), teach the AI about your > product, and send a test ticket. About 15 minutes for a website or web game. New studios get $2 > of AI credit, enough for around 150 tickets. Junco is a support desk with an AI that answers first. Your users report a bug, suggest a feature or ask for help from inside your product. The AI sorts every ticket, answers what it can from what you've taught it, groups duplicates, and hands you only what needs a person. When you fix something, the users who reported it are told. More in [What Junco is](/docs/overview). ## 0. Ask for an invite Junco is in early access and invite only. Use the form on Junco's website: say what you make, roughly how many users you have, and a link. We'll send an invite link, usually within a few days. There's nothing to pay to start. ## 1. Join your studio Open the invite link, enter your name and add a **passkey** (Face ID, a fingerprint or Windows Hello). There's no password. The link works once, for 7 days. Joining as your studio's admin means agreeing to the [terms](/legal/terms). To sign in on another phone or computer, sign in on one that has your passkey and add the new one under **Settings → Passkeys**, or use a passkey that syncs (iCloud Keychain, Google Password Manager, 1Password). ## 2. Add your product **Products → Add a product.** A product is anything with its own support form: a game, an app, a website. Give it a name, the web addresses it runs on (the form only works there), and say whether your users sign in. Each product gets a **public key** (`jk_...`), safe to put in your code. ## 3. Install the form On the product's page, pick one: - **Ask your AI.** Copy the prompt into Claude Code, Cursor, Copilot or whichever coding AI you use, inside your project. It has your key and points at the [install guide](/docs/install) and the steps [for coding AIs](/docs/for-ai-agents). It looks like this: ```prompt Add the Junco support form to this project. Follow https://desk.juncodesk.app/docs/for-ai-agents.md (plain Markdown) step by step. Public key: jk_YOUR_PUBLIC_KEY Junco server: https://desk.juncodesk.app ``` - **Paste a snippet.** A script tag for websites and web games. - **No code.** Turn on Junco's hosted support page and link to it from your app's menu, your store listing or your Discord. Phone apps and engines can also use the API: [Apps, engines and desktop](/docs/platforms). Send a test ticket. The product's page shows **Connected** as soon as it arrives. ## 4. Teach the AI The AI answers only from your product's **Knowledge**. Paste your FAQ or README and let the AI turn it into knowledge, or copy a prompt for your coding AI to write it from your code. Check it, then save. More in [Teaching the AI](/docs/knowledge). ## 5. Check the AI is ready New studios start with **$2 of AI credit**, enough for around 150 tickets on the default model. Top up on the **AI** page when you need to. See [Pricing and AI credit](/docs/pricing). ## 6. And then - **Connect GitHub** to turn bugs into issues in a tap and tell users when the fix ships. [GitHub and releases](/docs/github). - **Invite your team** under **Settings → Team**. Admins set things up (products, GitHub, the team); members work the inbox. Your plan may set how many people your studio can have. - **Phone alerts** on the **Alerts** page, for anything urgent the AI hands to you. [Using the desk](/docs/desk) The **Get started** page in Junco ticks each step off by itself. --- # Pricing and AI credit > **In short.** During early access there is **no subscription** and no fee to use Junco. You pay > only for the AI, **at cost**: what the AI model charges for each ticket, about **one to two US > cents**, with nothing added per ticket. New studios get **$2 of credit** to start (roughly 150 > tickets). Top up in packs of $10, $25, $50 or $100, plus 10% to cover card and provider fees. > When credit runs out the AI pauses; tickets still arrive and nothing is lost. ## What you pay for | | Price | |---|---| | Using Junco: the desk, the form, the hosted page, GitHub, releases, alerts, your whole team | **Free during early access** | | Tickets, users, products, team members, storage | No per-item charge | | The AI | **At cost**, from prepaid credit in US dollars | | Topping up credit | Packs of **$10, $25, $50, $100**, plus a **10% fee** on top (a $10 pack costs $11) | | Starting credit for a new studio | **$2**, free | Before early access ends, we'll agree a price with you well ahead of any change. Nothing changes without notice. ## What a ticket costs Each AI step is charged exactly what the model charged for it, in dollars: - **Triage and first reply**: reading the ticket and your knowledge, sorting it and writing a reply. Most of the cost, because your knowledge is read every time. - **The reply check**: a second, cheaper model reads the reply against a checklist. - **Follow-ups**: when the user writes again, the AI reads the conversation and answers again (at most four AI replies a ticket before a person takes over). - **Drafts you ask for**: a GitHub issue from a group of reports, or knowledge from your help text. Usually a cent or two each. On the default model (Google Gemini Flash, with Flash-Lite as the checker), a typical ticket costs **about $0.01 to $0.02**, all steps included. Shorter knowledge costs less: it's read for every ticket. ### Worked examples | Users' tickets a month | Rough AI cost a month | |---|---| | 100 | $1 to $2 | | 1,000 | $10 to $20 | | 10,000 | $100 to $200 | The **AI** page on the desk shows the real figures: spend per product and per month, tickets answered and how many replies passed their checks. ## Credit - Credit belongs to the **studio** and is shared by all its products. - Every AI call comes off the balance as it happens. - **Buy credit** on the **AI** page, by card. - **Low credit alert**: set the amount on the AI page; Junco alerts you when the balance drops below it. - **When credit runs out**, the AI pauses: new tickets come straight to **Needs you** and nothing is lost. Top up and it carries on with new tickets. ## Switches and caps On the **AI** page, admins can: - **Switch the AI off for the whole studio**: tickets come straight to you. - **Switch it off for one product.** - **Hold every reply** for a product, so a person approves each one before it's sent (the AI still sorts and groups). - **Set a monthly cap** per product, in dollars (from $0.50). Once a product reaches it, its AI pauses until the start of next month. Junco may also hold every reply for a product by itself if replies start failing their checks much more often than usual (see [How the AI works](/docs/ai)); you turn it back on. ## Questions about money - **Is there a free plan?** Junco itself is free during early access, and $2 of credit is free. Without credit you can still use the desk with the AI off. - **Can I use my own AI key?** Not yet. Each studio's credit is kept on its own key with OpenRouter, limited to that studio's balance. - **Refunds of unused credit?** Ask us. A refunded card payment takes its credit back off your balance (half for a half refund). - **Currency?** US dollars, because AI models are priced in dollars. - **Invoices and VAT?** Every card top-up comes with an invoice from Stripe, for your accounts. For VAT, ask us. --- # Is Junco right for you? > **In short.** Junco suits small game and app teams who get lots of reports from users, want an > AI to answer the repetitive ones safely, and fix things through GitHub. It's less suited to > teams who need email or live chat support, many channels in one inbox, or a large support team > with workflows and SLAs. ## Good fits - **An indie or small studio** with thousands of players and nobody whose job is support. - **A web game or web app**: one script tag, and reports arrive with a screenshot, the save and the game state. - **A team that lives in GitHub**: groups of reports become issues; closing them and releasing tells every user who reported it. - **A product with young users**: personal details never reach the AI, replies are checked for safety, users can delete what they've sent, and there's a plain privacy notice for them. - **Someone who wants their coding AI to do the install**: Junco gives a prompt, and these guides are written for it. ## Not a fit (yet) - **Email or chat as channels.** Junco takes reports from its form and hosted page only, and replies there. It doesn't read an inbox or send users email. - **Live chat.** Replies arrive in the thread, not as a live conversation with an agent. - **Big support teams** wanting macros, SLAs, assignment rules, skills routing or reporting across many agents. - **Phone or console apps that want a drop-in SDK**: there's a hosted page and a small API with code to copy, but no packaged SDKs yet. - **Data outside the UK**: Junco runs in one region, the United Kingdom. - **Open sign-up**: early access is by invite. ## Compared with other ways of doing support | | Junco | General help desks (for example Zendesk, Freshdesk, Help Scout, Intercom) | Discord or forums | GitHub issues for users | Email | |---|---|---|---|---|---| | Built for | Users of games and apps, from inside the product | Customer service across email, chat and more | Community | Developers | Anything | | Context with each report | Version, screen, device, screenshot, save, log | What the user types, plus what you wire up | What the user types | What the user types | What the user types | | First answer | AI in seconds, checked, held when unsure | Varies by product and plan | Whoever's online | You | You | | Duplicates | Grouped automatically, "12 users have this" | Usually by hand | Threads pile up | By hand | By hand | | Privacy for users | Private threads; personal details kept from the AI; delete-it-yourself | Private | Public | Public | Private | | Tells users when it's fixed | Yes, automatically on release | By hand or with automation | By hand | If they watch the issue | By hand | | Price | Free in early access; AI at cost (about $0.01 to $0.02 a ticket) | Usually per agent per month | Free | Free | Free | Crash and error reporting tools (Sentry, Backtrace, Bugsnag and the like) catch crashes automatically; Junco handles what people tell you. They work well together: put your crash tool's event id in Junco's `context`. ## How Junco is different - **AI first, but careful.** The AI answers only from what you've taught it, a second model checks every reply, and anything about money, accounts, bans, safety or other users goes to a person. - **Made by a game developer** for their own game first (Vaelis), so the details are game-shaped: screenshots before the panel covers the game, keys that don't reach the game while typing, "Save and log". - **At cost.** You pay what the AI model charges, nothing added per ticket. - **Docs for AIs.** Every guide is Markdown, with `/llms.txt`, `/llms-full.txt` and an OpenAPI file, so a coding AI can install it and an assistant can answer questions about it. --- # Questions > **In short.** Short answers, each linking to the guide with the details. ## About Junco **What is Junco?** A support desk for game and app studios with an AI that answers first. Users report bugs, suggest features or ask for help from inside your product; the AI answers from what you've taught it, groups duplicates and hands you what needs a person. [What Junco is](/docs/overview) **Who makes it?** Big Beans Studio, an independent studio in the United Kingdom, first for its own browser space game, Vaelis. **Is it only for games?** No. Any product with users: games, apps, websites, tools. The desk says "product" and "user". **How do I get it?** It's in early access, invite only. Ask with the form on Junco's website; you'll get an invite link. [Getting started](/docs/getting-started) **How much does it cost?** No subscription during early access. The AI is charged at cost, about $0.01 to $0.02 a ticket, from prepaid credit; new studios get $2 free. [Pricing and AI credit](/docs/pricing) ## Installing **How long does it take to install?** For a website or web game, minutes: one script tag. Paste the product's "Ask your AI" prompt into your coding AI and it does it. [Installing the form](/docs/install) **Does it work with React / Next.js / Vue / Svelte / Angular?** Yes, with a few lines; recipes for each in [Installing the form](/docs/install). **Unity, Godot, Unreal, iOS, Android, Flutter, React Native?** Yes, through the hosted page (no code) or the HTTP API, with code to copy. [Apps, engines and desktop](/docs/platforms) **Is there an npm package or SDK?** No. The widget is one script loaded from Junco; other platforms call a small HTTP API. **Will it clash with my site's styles or my game's controls?** No. It lives in a closed shadow root, and keys and clicks inside it don't reach your page. [Widget reference](/docs/widget) **Do my users need an account?** No. Junco remembers them by a random id in their browser or app, or your server vouches for signed-in users with a token. [Signed user tokens](/docs/user-tokens) ## The AI **Which AI does it use?** Google Gemini (Flash to write, Flash-Lite to check), through OpenRouter, with zero data retention. **Can it say something wrong or embarrassing?** Every reply passes rules in code and a second model's checklist (safe, on topic, true to your knowledge, no personal details, no promises, no following instructions hidden in the message), or it's held for you. You can also hold every reply for approval. [How the AI works](/docs/ai) **What does the AI know about my product?** Only what you put in its knowledge. Paste your FAQ or README and it drafts it for you. [Teaching the AI](/docs/knowledge) **What languages?** It replies in the user's language. **Can I turn the AI off?** Yes, per product or for the whole studio, or set a monthly cap. Tickets then come straight to you. **What happens when credit runs out?** The AI pauses; tickets keep arriving and come to you. Nothing is lost. ## Data and privacy **Where is data stored?** On Junco's own servers in the United Kingdom. **Does the AI see my users' personal details?** No. Emails, phone numbers, addresses, card numbers, names and passwords are replaced with placeholders first. [Your users' data](/docs/data) **Can users delete their data?** Yes, themselves, from the form: "Delete everything I've sent". Admins can also download or delete a user's data from any of their tickets. **Is it GDPR-friendly?** Junco acts as your processor, with a data processing agreement, a sub-processor list, retention limits and tools for access and deletion requests. [Legal](/legal) ## Working with it **Does it work on my phone?** Yes: the desk is built for phones first, with phone alerts. [Using the desk](/docs/desk) **Does it connect to GitHub?** Yes, optionally: issues from groups of reports, and releases that tell users. [GitHub and releases](/docs/github) **Can I invite my team?** Yes, as Admins or Members, from Settings → Team. **Is there an API?** Yes, for raising and reading tickets as a user, and for releases from deploy scripts. [API reference](/docs/api), `/openapi.json`. --- # For coding AIs > **In short.** This page is written for AI coding agents (Claude Code, Cursor, Copilot, Codex and > the like) adding Junco to a project. Follow it top to bottom. You need two values from the > human: the product's **public key** (`jk_...`) and Junco's **server address** > (`https://desk.juncodesk.app`). For a website or web game, add one script and one `Junco.init` call. For > anything else, link the hosted page or call the HTTP API. Then send a test ticket. If you're a person, copy this into your coding AI inside your project, with your product's key in place of `jk_YOUR_PUBLIC_KEY`. Junco's desk gives you a longer one with your details already filled in: a product's page, **Install**, **Ask your AI**. ```prompt Add the Junco support form to this project. Follow https://desk.juncodesk.app/docs/for-ai-agents.md (plain Markdown) step by step. Public key: jk_YOUR_PUBLIC_KEY Junco server: https://desk.juncodesk.app Ask me for anything else that guide says you need. When it's done, send a test ticket and tell me what you changed and anything I need to do myself. ``` ## 1. Get what you need from the human You can't make these yourself; they come from the product's page on Junco's desk. Ask for any you don't have, in one message: | Value | Looks like | Needed for | Secret? | |---|---|---|---| | Public key | `jk_` + about 20 characters | Everything | **No.** Safe in client code. | | Junco server | `https://desk.juncodesk.app` | Everything | No | | The site's web addresses | `https://example.com` | Web: each must be listed on the product in Junco, exactly (scheme, host and port if any; no path), or the form is refused. `https://` only, except `http://localhost:` and `http://127.0.0.1:` for development. Up to 20. | No | | Do users sign in? | yes / no | Choosing how users are recognised | | | Signing key | a `.pem` file, Ed25519 private key | Only if users sign in and the human wants tickets to follow accounts | **Yes.** Server only. | | Release key | `jr_...` | Only for telling users from a deploy script that fixes are live | **Yes.** CI secrets only. | If the human has no Junco account: Junco is invite only for now; they ask for an invite on Junco's website. You can still write the code with a placeholder key and tell them. ## 2. Pick the way in Look at the project and choose one: | The project is | Do this | |---|---| | A website, web app or web game (any framework: plain HTML, React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, Phaser, PixiJS, three.js, Babylon.js, Godot or Unity **web export**) | **The widget.** Section 3. | | An Electron or Tauri app | If its window loads an `https://` site, the widget (section 3). If it loads local files (`file://`, `app://`, `tauri://`), Junco can't allow that origin: use the hosted page, or the API from the main process (section 4). | | A phone app (Swift, Kotlin, Flutter, React Native), a desktop or console game, a native Unity/Godot/Unreal build | **The hosted page** (no code: open a URL) or **the API** (your own form). Section 4. | | A Discord server, store page or docs site | **The hosted page**: a link. Section 4. | | A backend only | Usually nothing; if it should report problems itself, use the API with a signed token. | ## 3. Websites and web games: the widget ### 3.1 Load and start it once Add this where the app starts, on every page that should have support. Call `Junco.init` exactly once per page load; later calls are ignored. ```html ``` In a bundled app (React, Vue, Svelte and so on), load the script at runtime instead of importing it. There's no npm package. A helper that works everywhere, including with server-side rendering: ```js // junco.js: load Junco's widget once, in the browser only. let loading; export function startJunco(options) { if (typeof window === "undefined") return Promise.resolve(null); // server-side render: skip loading ??= new Promise((resolve, reject) => { const s = document.createElement("script"); s.src = `${options.server}/widget/junco.js`; s.async = true; s.onload = () => resolve(window.Junco.init(options)); s.onerror = () => reject(new Error("Couldn't load Junco")); document.head.append(s); }); return loading; } ``` Call `startJunco({...})` from the app's root once mounted: `useEffect(() => { startJunco(...) }, [])` in React or Next.js (in a `"use client"` component), `onMounted` in Vue, `onMount` in Svelte. Recipes per framework: [Installing the form](/docs/install). **Options are read once**, at init. To send what's current when the user opens the form, pass **functions** that read the current state (`context: () => store.getState()...`), not values. ### 3.2 Put it where users look for help - If the app has a help, menu, settings or account area, add a **Support** (or **Help**) item there that calls `Junco.open()`, and pass `button: false` to hide Junco's own round button. - `Junco.open({ type: "bug" })` opens straight to a bug report (`"idea"`, `"help"` too). - If there's no sensible place, leave `button` out: Junco shows a small round button in the bottom right corner. ### 3.3 Send useful context, never personal details `context` returns a plain object (under 16 KB as JSON) the team sees with the ticket and the AI reads. Good things to send: app version or build, current screen or route, platform and browser, screen size, language, relevant settings, the user's current level or place, feature flags, recent errors. **Never** send passwords, tokens, cookies, emails, phone numbers, addresses or payment details. ```js context: () => ({ version: "1.4.2", screen: router.currentRoute, device: navigator.userAgent, viewport: `${innerWidth}x${innerHeight}`, language: navigator.language, level: game.level?.id, }), ``` ### 3.4 Screenshots, saves and logs (games especially) All optional, all callbacks, called when needed; each may return a promise. ```js screenshot: () => new Promise((resolve) => { // A canvas game. WebGL needs preserveDrawingBuffer: true, or call this right after a render. const c = document.querySelector("canvas"); const scale = Math.min(1, 1280 / c.width); const out = document.createElement("canvas"); out.width = Math.round(c.width * scale); out.height = Math.round(c.height * scale); out.getContext("2d").drawImage(c, 0, 0, out.width, out.height); out.toBlob(resolve, "image/jpeg", 0.8); }), save: () => JSON.stringify(game.saveData()), // up to 1 MB log: () => recentLogLines.join("\n"), // up to 512 KB, text ``` The screenshot is taken when the panel opens, before it covers the screen; the user chooses whether to attach it. Keep it a JPEG at most 1280 px wide (it must be under 2 MB). ### 3.5 Signed-in users (optional) Without anything extra, Junco recognises a user by a random id kept in their browser. If the app has accounts and the human wants tickets to follow the account across devices: 1. On the **server**, add an endpoint (e.g. `GET /api/junco-token`) that returns a token for the signed-in user, signed with the `.pem` key from an environment variable (`JUNCO_SIGNING_KEY`). Code for Node, Python, Go, PHP and others: [Signed user tokens](/docs/user-tokens). 2. In the browser: `playerToken: () => fetch("/api/junco-token").then((r) => (r.ok ? r.text() : null))`. Never put the private key in client code or the repo. ### 3.6 Content Security Policy If the project sets a CSP (a meta tag, a header in server config, `next.config.js`, `helmet`, Netlify/Vercel headers), add `https://desk.juncodesk.app` to `script-src` and `connect-src`. Nothing else is needed: the widget uses no inline scripts, no iframes and no third parties. ### 3.7 Unread badge (optional) If the app shows notification badges: `onUnread: (n) => setSupportBadge(n)`. Junco calls it with the number of tickets that have replies the user hasn't read. ## 4. Everything else: hosted page or API **Hosted page (no code).** The human turns on "Junco's support page" on the product's page in Junco; then open `https://desk.juncodesk.app/s/jk_YOUR_PUBLIC_KEY` from a Help or Support menu item, in the system browser or an in-app browser (`SFSafariViewController`, Custom Tabs, `Application.OpenURL`, `OS.shell_open`, `url_launcher`, `Linking.openURL`). It remembers the user in that browser. It can't receive game state or signed-in identity; for those, use the API. **API (your own form).** Four calls: raise a ticket, list tickets, read one, reply. Make a random id once per install and keep it. Complete examples for Unity, Godot, Swift, Kotlin, Flutter and React Native: [Apps, engines and desktop](/docs/platforms). Reference: [API](/docs/api) and `https://desk.juncodesk.app/openapi.json`. ## 5. Check it works 1. Run the app, open the form, send a **bug** report saying "Junco test". 2. You should see the thread with your message and, if the AI is on for the product, its reply within a few seconds (typing dots while it writes). 3. The product's page in Junco now says **Connected**. Ask the human to check. From a terminal, the same test without a browser (a random id, no `Origin` header): ```sh curl -s -X POST https://desk.juncodesk.app/v1/games/jk_YOUR_PUBLIC_KEY/tickets \ -H "Content-Type: application/json" \ -H "X-Junco-Player: $(head -c 24 /dev/urandom | base64 | tr '+/' '-_' | tr -d '=')" \ -d '{"type":"bug","text":"Junco test from the command line"}' ``` If something fails, look the message up in [Troubleshooting](/docs/troubleshooting). The common ones: `This page isn't allowed to use this game's support` (the page's origin isn't listed on the product in Junco), a CSP error in the console, `This game needs a player token`. ## 6. Rules - **Don't** put the signing key (`.pem`) or a release key (`jr_...`) in client code, the repo or logs. The public key (`jk_...`) is fine anywhere. - **Don't** put the form in an iframe, restyle it or reach into it: it lives in a closed shadow root and is built to be left alone. - **Don't** send personal details in `context`. - **Don't** copy `junco.js` into the repo unless the project's CSP or offline needs demand it; loading it from `https://desk.juncodesk.app` keeps it up to date. - **Do** call `Junco.init` once, with functions for anything that changes. - **Do** tell the human at the end: what you changed, which web addresses must be listed on the product in Junco, any secret they must add to the server's environment, and to turn on the hosted page if you linked to it. ## 7. TypeScript There's no types package; add this declaration if the project uses TypeScript: ```ts // junco.d.ts type JuncoMaybe = T | null | undefined | Promise; interface JuncoOptions { game: string; server?: string; context?: () => JuncoMaybe>; screenshot?: () => JuncoMaybe; save?: () => JuncoMaybe; log?: () => JuncoMaybe; playerToken?: () => JuncoMaybe; handle?: () => JuncoMaybe; button?: boolean; onUnread?: (count: number) => void; } interface JuncoApi { version: string; init(options: JuncoOptions): JuncoApi; open(options?: { type?: "bug" | "idea" | "help" }): Promise | undefined; close(): void; } declare global { interface Window { Junco: JuncoApi } const Junco: JuncoApi; } export {}; ``` Full details of every option: [Widget reference](/docs/widget). --- # Installing the form > **In short.** For websites and web games: load `https://desk.juncodesk.app/widget/junco.js` and call > `Junco.init({ game: "jk_...", server: "https://desk.juncodesk.app" })` once. It draws its own panel in a closed > shadow root (about 8 KB gzipped, no dependencies), works in any framework, and only answers on > the web addresses listed on the product in Junco. Phone apps, engines and desktop software use > the hosted page or the API: [Apps, engines and desktop](/docs/platforms). Every product has a **public key** (`jk_...`) on its page in Junco; it's safe to ship in client code. ## The quickest way: ask your coding AI Copy this into Claude Code, Cursor, Copilot or whichever coding AI you use, inside your project. The product's **Install** page in Junco gives you the same prompt with your key, web addresses and sign-in details already filled in; here they're placeholders. ```prompt Add the Junco support form to this project. Junco is the support desk I use: users report bugs, suggest features or ask for help, and I answer in Junco. Read the install guide first: https://desk.juncodesk.app/docs/install.md (plain Markdown). Details for this project: - Product: your product - Public key: jk_YOUR_PUBLIC_KEY (safe to put in client code) - Junco server: https://desk.juncodesk.app - Web addresses allowed to use it: none yet (ask me which address the site runs on; I'll add it in Junco) Do this: 1. Load https://desk.juncodesk.app/widget/junco.js and call Junco.init({ game: "jk_YOUR_PUBLIC_KEY", server: "https://desk.juncodesk.app", ... }) once when the app starts. It draws its own panel inside a shadow root, so our CSS can't break it. 2. Find the app's existing help, menu or settings area and add a "Support" (or "Help") item there that calls Junco.open(). Then pass button: false to hide Junco's own round button. If there's no sensible place, leave Junco's button on. 3. Pass context: () => ({ ... }) with what's useful when something goes wrong: the app's version, the current screen or page, and device details. Never include passwords, tokens, emails or other personal details. 4. If the app draws to a canvas, pass screenshot: () => a Blob of it (JPEG, at most 1280 px wide, under 2 MB). 5. If the project sets a Content-Security-Policy, allow https://desk.juncodesk.app in script-src and connect-src. 6. Users don't need to sign in: Junco keeps a random id in their browser. Don't add any login for it. 7. If the app shows a badge for notifications, pass onUnread: (n) => … to show replies the user hasn't read. When it's done, run the app, open the form and send a bug report saying "Junco test". Tell me what you changed and anything I need to do myself. ``` The rest of this page is what it reads, if you'd rather do it yourself. ## Plain HTML ```html ``` Put it before ``, or anywhere with `defer` on the first script. A round **Support** button appears in the bottom right corner. ## Before it works: allow your web addresses On the product's page in Junco, list every web address the form runs on: the scheme, host and port, with no path (`https://example.com`, `https://play.example.com`). `www.` is a different address. For development, `http://localhost:5173` (with your port) and `http://127.0.0.1:…` work. Up to 20. A page whose address isn't listed gets "This page isn't allowed to use this game's support". ## In a framework The widget isn't an npm package: load it at runtime, in the browser only, once. This helper works in every framework below, server-side rendering included: ```js // lib/junco.js let loading; export function startJunco(options) { if (typeof window === "undefined") return Promise.resolve(null); loading ??= new Promise((resolve, reject) => { const s = document.createElement("script"); s.src = `${options.server}/widget/junco.js`; s.async = true; s.onload = () => resolve(window.Junco.init(options)); s.onerror = () => reject(new Error("Couldn't load Junco")); document.head.append(s); }); return loading; } ``` **Options are read once.** Junco ignores a second `init`, so pass functions that read the current state (`context: () => ({ screen: currentScreen })`), not values captured at start-up. ### React (Vite, Create React App) ```jsx import { useEffect } from "react"; import { startJunco } from "./lib/junco"; export default function App() { useEffect(() => { startJunco({ game: "jk_...", server: "https://desk.juncodesk.app", context: () => ({ version: import.meta.env.VITE_APP_VERSION, page: location.pathname }), }); }, []); return ; } ``` React's Strict Mode runs effects twice in development; `startJunco` and `Junco.init` both only start once, so that's fine. ### Next.js (App Router) ```jsx // app/junco.jsx "use client"; import { useEffect } from "react"; import { usePathname } from "next/navigation"; import { startJunco } from "@/lib/junco"; let page = "/"; export default function Junco() { page = usePathname(); useEffect(() => { startJunco({ game: "jk_...", server: "https://desk.juncodesk.app", context: () => ({ page, version: process.env.NEXT_PUBLIC_VERSION }) }); }, []); return null; } ``` Render `` once in `app/layout.jsx`, inside ``. With the Pages Router, do the same in `pages/_app.jsx`. If you set a Content Security Policy in `next.config.js` or middleware, add `https://desk.juncodesk.app` to `script-src` and `connect-src`. ### Vue and Nuxt ```js // Vue: main.js, after app.mount("#app") import { startJunco } from "./lib/junco"; startJunco({ game: "jk_...", server: "https://desk.juncodesk.app", context: () => ({ page: router.currentRoute.value.fullPath }) }); ``` ```js // Nuxt: plugins/junco.client.js (".client" runs it in the browser only) import { startJunco } from "~/lib/junco"; export default defineNuxtPlugin((nuxtApp) => { const router = useRouter(); startJunco({ game: "jk_...", server: "https://desk.juncodesk.app", context: () => ({ page: router.currentRoute.value.fullPath }) }); }); ``` ### Svelte and SvelteKit ```svelte ``` (`onMount` only runs in the browser. In Svelte 4 use `$app/stores` and `get(page)`.) ### Angular ```ts // app.component.ts import { AfterViewInit, Component } from "@angular/core"; import { Router } from "@angular/router"; import { startJunco } from "./junco"; @Component({ selector: "app-root", templateUrl: "./app.component.html" }) export class AppComponent implements AfterViewInit { constructor(private router: Router) {} ngAfterViewInit() { startJunco({ game: "jk_...", server: "https://desk.juncodesk.app", context: () => ({ page: this.router.url }) }); } } ``` With server-side rendering, the `typeof window` check in the helper keeps it in the browser. ### Web games (canvas, WebGL, Phaser, PixiJS, three.js, Babylon.js) Games get the most from the extra callbacks: a screenshot, the save and recent log lines. ```js Junco.init({ game: "jk_...", server: "https://desk.juncodesk.app", button: false, // open it from the game's own menu context: () => ({ version: GAME_VERSION, scene: game.scene.key, level: state.level, fps: Math.round(game.loop.actualFps) }), screenshot: () => canvasShot(game.canvas), save: () => JSON.stringify(state.save()), log: () => logBuffer.join("\n"), handle: () => state.playerName, onUnread: (n) => menu.setBadge("support", n), }); pauseMenu.on("support", () => Junco.open()); pauseMenu.on("report-bug", () => Junco.open({ type: "bug" })); function canvasShot(canvas) { return new Promise((resolve) => { const scale = Math.min(1, 1280 / canvas.width); const out = document.createElement("canvas"); out.width = Math.round(canvas.width * scale); out.height = Math.round(canvas.height * scale); out.getContext("2d").drawImage(canvas, 0, 0, out.width, out.height); out.toBlob(resolve, "image/jpeg", 0.8); }); } ``` - **WebGL canvases** read back blank unless made with `preserveDrawingBuffer: true` (three.js: `new WebGLRenderer({ preserveDrawingBuffer: true })`; Phaser: `render: { preserveDrawingBuffer: true }`), or unless you render a frame just before reading. Without it you get a black image. - The screenshot is taken when the panel opens, before it covers the game. - Typing in the panel never reaches the game: keys, clicks and scrolls stay inside it, so shortcuts don't fire while someone writes a report. - Unity and Godot **web exports** are web pages: add the script to the export's HTML template and call `Junco.open()` from the game through JavaScript interop (`Application.ExternalEval` is gone; in Unity use a `.jslib` plugin; in Godot 4, `JavaScriptBridge.eval("Junco.open()")`). ## Opening it from your own menu ```js Junco.init({ game: "jk_...", server: "https://desk.juncodesk.app", button: false }); helpButton.addEventListener("click", () => Junco.open()); // the three choices bugButton.addEventListener("click", () => Junco.open({ type: "bug" })); // straight to one: bug, idea, help ``` Pass `onUnread` to put the number of unread replies on your own button. ## Signed-in users By default Junco recognises a user by a random id kept in their browser (`localStorage`), per product. If your users sign in, let your server vouch for them, and their tickets follow their account to any device: [Signed user tokens](/docs/user-tokens). ## Content Security Policy If your site sets one, allow `https://desk.juncodesk.app` in `script-src` and `connect-src`. Screenshots are sent as uploads, so nothing else is needed. If your policy can't load scripts from another origin, you may copy `junco.js` into your own site and serve it yourself (it still calls `https://desk.juncodesk.app`, so `connect-src` still needs it). You then miss updates until you copy it again; `Junco.version` says which you have. ## Phone apps, desktop games and anything else - **Junco's hosted page.** Turn on "Junco's support page" on the product's page and link to it (`https://desk.juncodesk.app/s/jk_...`) from your menu, store listing or community. - **The API.** Build your own form in Unity, Godot, Swift, Kotlin or anything that speaks HTTP. Both, with complete code: [Apps, engines and desktop](/docs/platforms). ## Check it works Open the form, send a bug report saying "Junco test", and look at the product's page in Junco: it says **Connected** when the first ticket arrives. If it doesn't: - **"This page isn't allowed to use this game's support"**: add the page's exact address on the product's page. - **Nothing appears**: look in the browser console for a Content Security Policy error, or a 404 for `junco.js` (check the server address). - **"This game needs a player token"**: the product only takes signed-in users and no token was sent. All the messages: [Troubleshooting](/docs/troubleshooting). Every option: [Widget reference](/docs/widget). --- # Widget reference > **In short.** `https://desk.juncodesk.app/widget/junco.js` defines one global, `Junco`, with `init(options)`, > `open({ type })`, `close()` and `version`. Only `game` is required (pass `server` too unless the > page is on Junco's own address). Every other option is a function Junco calls when it needs the > value; each may return a value, `null` or a promise, and may fail without breaking anything. ## `Junco.init(options)` Starts the widget. Call it once per page load; later calls are ignored and return `Junco`. If the page's `` doesn't exist yet, it waits for `DOMContentLoaded`. Throws only if `game` is missing. | Option | Type | Default | What it's for | |---|---|---|---| | `game` | `string` | required | The product's public key, `jk_...`. | | `server` | `string` | the page's own origin | Junco's address: `https://desk.juncodesk.app`. Always pass it on your own site. | | `context` | `() => object` | none | What's useful when something goes wrong: version, screen, device, settings. Called each time the panel opens. Up to 16 KB as JSON. No personal details. | | `screenshot` | `() => Blob` | none | An image of the screen (PNG, JPEG or WebP, under 2 MB). Called when the panel opens, before it covers the page. The user chooses whether to attach it. | | `save` | `() => Blob \| string` | none | The user's save or state (under 1 MB). A string is sent as JSON text. Asked for only if the user ticks "Save and log". | | `log` | `() => string` | none | Recent log lines (UTF-8 text, under 512 KB). With "Save and log". | | `playerToken` | `() => string` | none | A signed token from your server for a signed-in user ([Signed user tokens](/docs/user-tokens)). Called before every request; return `null` for users who aren't signed in. | | `handle` | `() => string` | none | The user's display name (up to 40 characters), shown to your team. A signed token's `name` wins over it. | | `button` | `boolean` | `true` | `false` hides Junco's round button; open the panel from your own menu instead. | | `onUnread` | `(count: number) => void` | none | Called when the number of tickets with replies the user hasn't read changes, for a badge on your own button. | "Function" options may be `async`. If one throws or rejects, Junco carries on without that value. ## `Junco.open(options?)` Opens the panel. With no argument it shows the three choices (**Report a bug**, **Suggest a feature**, **Get help**) and the user's earlier tickets. `Junco.open({ type: "bug" })` goes straight to one form; `type` is `"bug"`, `"idea"` or `"help"`. Returns a promise, or `undefined` before `init`. ## `Junco.close()` Closes the panel. The user can also press **Esc** or the close button; focus goes back to where it was. ## `Junco.version` The widget's version, such as `"0.1.6"`. ## What users see - **Home**: the three choices and their tickets, newest activity first, with a dot on those with unread replies. - **A form**: a text box (up to 5,000 characters), a **Screenshot** tick (if `screenshot` gave one) and **Save and log** (if `save` or `log` is set), and Send. - **The thread**: their messages, replies from "AI" and "the team" (never staff names, never internal notes), the ticket's status in words ("Being looked at", "With the developer", "Being worked on", "Fixed: coming in the next update", "Fixed and live"), typing dots while the AI writes, and a reply box. - **The footer**: a **Privacy** link to the notice for your product's users, and **Delete everything I've sent**, which deletes all their tickets, messages and files after a confirm. ## How it behaves - **Isolated.** It adds one element, ``, to the end of ``, with a closed shadow root: your CSS can't change it and its CSS can't change your page. It sits above everything (`z-index: 2147483000`), fixed to the bottom right. - **Quiet.** Keys, clicks, touches and scrolls inside it don't reach your page, so game controls and keyboard shortcuts don't fire while someone types. - **No cookies.** Requests go to `https://desk.juncodesk.app` with `credentials: "omit"`. - **Who the user is.** With a `playerToken`, the token. Otherwise a random id (32 URL-safe characters) kept in `localStorage` under `junco:player:`. If storage is blocked (some private modes), each visit gets a new id and earlier tickets aren't shown. - **Updates.** It checks for unread replies when it starts, every minute, and when the tab comes back into view; every 10 seconds while a thread is open; every 1.5 seconds while the AI is writing (for up to 90 seconds). It does nothing while the tab is hidden. - **Phones.** The panel is laid out for small screens first (a sheet from the bottom) and stays above the on-screen keyboard. - **Size.** About 21 KB, 8 KB gzipped, no dependencies. Served with a 5-minute cache. - **Accessible.** Keyboard only works throughout; it's labelled for screen readers and respects reduced motion. ## Example with everything ```js Junco.init({ game: "jk_...", server: "https://desk.juncodesk.app", button: false, context: () => ({ version: APP_VERSION, screen: router.current, device: navigator.userAgent, language: navigator.language }), screenshot: () => captureCanvasAsJpeg(), save: () => JSON.stringify(store.exportSave()), log: () => logger.recent(200).join("\n"), playerToken: () => fetch("/api/junco-token").then((r) => (r.ok ? r.text() : null)), handle: () => session.user?.displayName, onUnread: (n) => (supportBadge.textContent = n ? String(n) : ""), }); document.querySelector("#support").addEventListener("click", () => Junco.open()); ``` TypeScript declarations: [For coding AIs](/docs/for-ai-agents), section 7. --- # Apps, engines and desktop > **In short.** Outside a web page there are two ways in. **The hosted page**: turn it on for the > product and open `https://desk.juncodesk.app/s/jk_...` from a Help menu; no code. **The API**: build your own > form with four HTTP calls, sending a random id you make once per install in the > `X-Junco-Player` header. Native apps send no `Origin` header, so no web address needs listing. > Complete code below for Unity, Godot, Swift, Kotlin, Flutter and React Native. ## Which to use | | Hosted page | API | |---|---|---| | Code | One line to open a URL | A small client and your own screens | | Looks like | Junco's page (light and dark), in a browser | Your app | | Game state, screenshot, save, log | No (device, screen size and language only) | Yes | | Signed-in users follow their account | No: one browser, one user | Yes, with [signed tokens](/docs/user-tokens) | | Products that only allow signed-in users | Doesn't work | Works | | Users see replies | When they open the page again | Where you show them (poll `GET /unread` for a badge) | Start with the hosted page if you want support working today; move to the API when you want game state and screenshots. ## The hosted page 1. On the product's page in Junco, turn on **Junco's support page**. 2. Open `https://desk.juncodesk.app/s/jk_YOUR_PUBLIC_KEY` from your Help or Support menu, your store listing, your Discord or your website. | Platform | Open it with | |---|---| | iOS | `SFSafariViewController` or `UIApplication.shared.open(url)` | | Android | Custom Tabs (`CustomTabsIntent`) or `Intent.ACTION_VIEW` | | Unity | `Application.OpenURL(url)` | | Godot | `OS.shell_open(url)` | | Unreal | `FPlatformProcess::LaunchURL(*Url, nullptr, nullptr)` | | Flutter | `launchUrl(Uri.parse(url))` (`url_launcher`) | | React Native | `Linking.openURL(url)` | | Electron | `shell.openExternal(url)` | The page can't be put in an iframe. It remembers the user in that browser, so open it the same way each time. It needs "Without an account" on for the product. ## The API Everything is under `https://desk.juncodesk.app/v1/games//`. The full reference is [API](/docs/api); OpenAPI: `https://desk.juncodesk.app/openapi.json`. The four calls a form needs: | Call | Does | |---|---| | `POST /tickets` with `{"type", "text", "context"}` | Raise a ticket (`type`: `bug`, `idea` or `help`). 201 with the ticket and its messages. | | `GET /tickets` | The user's tickets, each with `unread`. | | `GET /tickets/` | One ticket's messages (marks it read). While `aiWorking` is true, ask again every 2 seconds or so. | | `POST /tickets//messages` with `{"text"}` | The user replies. | Plus `GET /unread` (`{"count"}`, for a badge) and `DELETE /me` (the user deletes everything they've sent; offer it in your settings). Errors are `{"error": "..."}` in words you can show the user. **The user's id.** Make 24 random bytes, encode them as URL-safe base64 without padding (32 characters) or as hex (48), store it, and send it as `X-Junco-Player` on every call. Losing it loses access to their old tickets; keep it with the user's other settings. If your users sign in, send `Authorization: Bearer ` from your server instead ([Signed user tokens](/docs/user-tokens)). **Screenshots and files.** Send `multipart/form-data` instead of JSON: a `ticket` field holding the same JSON as text, and up to three files named `screenshot` (PNG, JPEG or WebP, under 2 MB), `save` (under 1 MB) and `log` (UTF-8 text, under 512 KB). ### Unity (C#) Works in Unity 2020.3 and later, on every platform, with no packages. ```csharp using System; using System.Collections; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using UnityEngine; using UnityEngine.Networking; // Add to a GameObject in your first scene; call from your UI with StartCoroutine(...). public class JuncoSupport : MonoBehaviour { const string Server = "https://desk.juncodesk.app"; const string PublicKey = "jk_YOUR_PUBLIC_KEY"; static string Base => $"{Server}/v1/games/{PublicKey}"; [Serializable] public class Message { public string id; public string @from; public string text; public string at; } [Serializable] public class Ticket { public int number; public string type; public string status; public string stage; public string title; public bool unread; public bool aiWorking; public Message[] messages; } [Serializable] class TicketList { public Ticket[] tickets; } [Serializable] class Unread { public int count; } [Serializable] class ApiError { public string error; } [Serializable] class Context { public string version; public string platform; public string device; public string os; public string scene; public string language; } [Serializable] class NewTicket { public string type; public string text; public Context context; } [Serializable] class NewReply { public string text; } static string PlayerId { get { var id = PlayerPrefs.GetString("junco_player", ""); if (id.Length >= 32) return id; var bytes = new byte[24]; using (var rng = RandomNumberGenerator.Create()) rng.GetBytes(bytes); id = Convert.ToBase64String(bytes).Replace('+', '-').Replace('/', '_').TrimEnd('='); PlayerPrefs.SetString("junco_player", id); PlayerPrefs.Save(); return id; } } // type: "bug", "idea" or "help". Takes a screenshot first if asked. public IEnumerator Report(string type, string text, bool withScreenshot, Action done, Action failed) { byte[] shot = null; if (withScreenshot) { yield return new WaitForEndOfFrame(); var tex = ScreenCapture.CaptureScreenshotAsTexture(); shot = tex.EncodeToJPG(60); Destroy(tex); if (shot.Length > 2_000_000) shot = null; // over Junco's 2 MB limit: send without it } var ticket = new NewTicket { type = type, text = text, context = new Context { version = Application.version, platform = Application.platform.ToString(), device = SystemInfo.deviceModel, os = SystemInfo.operatingSystem, scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name, language = Application.systemLanguage.ToString(), }, }; var form = new List { new MultipartFormDataSection("ticket", JsonUtility.ToJson(ticket)) }; if (shot != null) form.Add(new MultipartFormFileSection("screenshot", shot, "screenshot.jpg", "image/jpeg")); using var req = UnityWebRequest.Post($"{Base}/tickets", form); yield return Send(req, json => done(JsonUtility.FromJson(json)), failed); } public IEnumerator Tickets(Action done, Action failed) { using var req = UnityWebRequest.Get($"{Base}/tickets"); yield return Send(req, json => done(JsonUtility.FromJson(json).tickets), failed); } public IEnumerator Open(int number, Action done, Action failed) { using var req = UnityWebRequest.Get($"{Base}/tickets/{number}"); yield return Send(req, json => done(JsonUtility.FromJson(json)), failed); } public IEnumerator Reply(int number, string text, Action done, Action failed) { using var req = new UnityWebRequest($"{Base}/tickets/{number}/messages", "POST"); req.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(JsonUtility.ToJson(new NewReply { text = text }))); req.downloadHandler = new DownloadHandlerBuffer(); req.SetRequestHeader("Content-Type", "application/json"); yield return Send(req, json => done(JsonUtility.FromJson(json)), failed); } public IEnumerator UnreadCount(Action done) { using var req = UnityWebRequest.Get($"{Base}/unread"); yield return Send(req, json => done(JsonUtility.FromJson(json).count), _ => done(0)); } static IEnumerator Send(UnityWebRequest req, Action ok, Action failed) { req.SetRequestHeader("X-Junco-Player", PlayerId); yield return req.SendWebRequest(); var body = req.downloadHandler?.text ?? ""; if (req.result == UnityWebRequest.Result.Success) { ok(body); yield break; } var err = body.StartsWith("{") ? JsonUtility.FromJson(body)?.error : null; failed(err ?? "Couldn't reach support. Try again in a moment."); } } ``` `JsonUtility` can't read dictionaries, so `context` is a class: add the fields you want. To show replies arriving, call `Open` every 2 seconds while `aiWorking` is true. WebGL builds: use the widget in the page template instead ([Installing the form](/docs/install)). ### Godot 4 (GDScript) ```gdscript # junco.gd: add as an autoload named Junco. Calls one at a time (HTTPRequest is single-use). extends Node const SERVER := "https://desk.juncodesk.app" const KEY := "jk_YOUR_PUBLIC_KEY" var _http := HTTPRequest.new() func _ready() -> void: add_child(_http) func player_id() -> String: var cfg := ConfigFile.new() cfg.load("user://junco.cfg") var id: String = cfg.get_value("junco", "player", "") if id.length() < 32: id = Crypto.new().generate_random_bytes(24).hex_encode() # 48 hex characters cfg.set_value("junco", "player", id) cfg.save("user://junco.cfg") return id func _context() -> Dictionary: return { "version": ProjectSettings.get_setting("application/config/version", ""), "os": OS.get_name(), "device": OS.get_model_name(), "scene": get_tree().current_scene.scene_file_path if get_tree().current_scene else "", "language": OS.get_locale(), } # Returns the answer as a Dictionary; on failure, {"error": "..."} to show the user. func _call(path: String, method := HTTPClient.METHOD_GET, body = null) -> Dictionary: var headers := PackedStringArray(["X-Junco-Player: " + player_id()]) var data := "" if body != null: headers.append("Content-Type: application/json") data = JSON.stringify(body) var err := _http.request(SERVER + "/v1/games/" + KEY + path, headers, method, data) if err != OK: return {"error": "Couldn't reach support."} var res: Array = await _http.request_completed # [result, code, headers, body] var parsed = JSON.parse_string(res[3].get_string_from_utf8()) if typeof(parsed) != TYPE_DICTIONARY: return {"error": "Couldn't reach support."} return parsed func report(type: String, text: String) -> Dictionary: return await _call("/tickets", HTTPClient.METHOD_POST, {"type": type, "text": text, "context": _context()}) func tickets() -> Array: return (await _call("/tickets")).get("tickets", []) func open_ticket(number: int) -> Dictionary: return await _call("/tickets/%d" % number) func reply(number: int, text: String) -> Dictionary: return await _call("/tickets/%d/messages" % number, HTTPClient.METHOD_POST, {"text": text}) func unread() -> int: return int((await _call("/unread")).get("count", 0)) # A report with a screenshot, as multipart/form-data. func report_with_screenshot(type: String, text: String) -> Dictionary: var img := get_viewport().get_texture().get_image() if img.get_width() > 1280: img.resize(1280, int(img.get_height() * 1280.0 / img.get_width())) var jpg := img.save_jpg_to_buffer(0.7) var b := "junco" + str(randi()) var body := PackedByteArray() body.append_array(("--%s\r\nContent-Disposition: form-data; name=\"ticket\"\r\n\r\n%s\r\n" % [b, JSON.stringify({"type": type, "text": text, "context": _context()})]).to_utf8_buffer()) body.append_array(("--%s\r\nContent-Disposition: form-data; name=\"screenshot\"; filename=\"screenshot.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n" % b).to_utf8_buffer()) body.append_array(jpg) body.append_array(("\r\n--%s--\r\n" % b).to_utf8_buffer()) var headers := PackedStringArray(["X-Junco-Player: " + player_id(), "Content-Type: multipart/form-data; boundary=" + b]) _http.request_raw(SERVER + "/v1/games/" + KEY + "/tickets", headers, HTTPClient.METHOD_POST, body) var res: Array = await _http.request_completed var parsed = JSON.parse_string(res[3].get_string_from_utf8()) return parsed if typeof(parsed) == TYPE_DICTIONARY else {"error": "Couldn't reach support."} ``` Use it with `var t = await Junco.report("bug", text)`; check `t.has("error")`. Web exports: use the widget in the HTML shell instead. ### iOS (Swift) ```swift import Foundation import UIKit struct JuncoMessage: Decodable { let id: String; let from: String; let text: String; let at: String } struct JuncoTicket: Decodable { let number: Int; let type: String; let status: String; let stage: String? let title: String; let unread: Bool; let messages: [JuncoMessage]?; let aiWorking: Bool? } struct JuncoError: Error, Decodable { let error: String } enum Junco { static let server = "https://desk.juncodesk.app" static let key = "jk_YOUR_PUBLIC_KEY" static var playerId: String { if let id = UserDefaults.standard.string(forKey: "junco.player"), id.count >= 32 { return id } var bytes = [UInt8](repeating: 0, count: 24) _ = SecRandomCopyBytes(kSecRandomDefault, bytes.count, &bytes) let id = bytes.map { String(format: "%02x", $0) }.joined() UserDefaults.standard.set(id, forKey: "junco.player") return id } private static func call(_ path: String, method: String = "GET", body: [String: Any]? = nil) async throws -> T { var req = URLRequest(url: URL(string: "\(server)/v1/games/\(key)\(path)")!) req.httpMethod = method req.setValue(playerId, forHTTPHeaderField: "X-Junco-Player") if let body { req.httpBody = try JSONSerialization.data(withJSONObject: body) req.setValue("application/json", forHTTPHeaderField: "Content-Type") } let (data, response) = try await URLSession.shared.data(for: req) let code = (response as? HTTPURLResponse)?.statusCode ?? 0 guard (200..<300).contains(code) else { throw (try? JSONDecoder().decode(JuncoError.self, from: data)) ?? JuncoError(error: "Couldn't reach support. Try again in a moment.") } return try JSONDecoder().decode(T.self, from: data) } /// type: "bug", "idea" or "help" @MainActor static func report(_ type: String, _ text: String, screen: String) async throws -> JuncoTicket { let info = Bundle.main.infoDictionary ?? [:] let context: [String: Any] = [ "version": info["CFBundleShortVersionString"] ?? "", "build": info["CFBundleVersion"] ?? "", "os": "\(UIDevice.current.systemName) \(UIDevice.current.systemVersion)", "device": UIDevice.current.model, "screen": screen, "language": Locale.preferredLanguages.first ?? "", ] return try await call("/tickets", method: "POST", body: ["type": type, "text": text, "context": context]) } struct List: Decodable { let tickets: [JuncoTicket] } struct Count: Decodable { let count: Int } static func tickets() async throws -> [JuncoTicket] { try await (call("/tickets") as List).tickets } static func ticket(_ number: Int) async throws -> JuncoTicket { try await call("/tickets/\(number)") } static func reply(_ number: Int, _ text: String) async throws -> JuncoTicket { try await call("/tickets/\(number)/messages", method: "POST", body: ["text": text]) } static func unread() async throws -> Int { try await (call("/unread") as Count).count } } ``` Errors are `JuncoError`; show `error.error` to the user. A message's `from` is `player` (the user), `ai` or `staff`. ### Android (Kotlin) No libraries beyond Kotlin coroutines; `org.json` is part of Android. ```kotlin import android.content.Context import android.os.Build import android.util.Base64 import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.json.JSONObject import java.io.IOException import java.net.HttpURLConnection import java.net.URL import java.security.SecureRandom object Junco { private const val SERVER = "https://desk.juncodesk.app" private const val KEY = "jk_YOUR_PUBLIC_KEY" private fun playerId(ctx: Context): String { val prefs = ctx.getSharedPreferences("junco", Context.MODE_PRIVATE) prefs.getString("player", null)?.takeIf { it.length >= 32 }?.let { return it } val bytes = ByteArray(24).also { SecureRandom().nextBytes(it) } val id = Base64.encodeToString(bytes, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) prefs.edit().putString("player", id).apply() return id } /** Throws IOException with a message you can show the user. */ private suspend fun call(ctx: Context, path: String, method: String = "GET", body: JSONObject? = null): JSONObject = withContext(Dispatchers.IO) { val conn = URL("$SERVER/v1/games/$KEY$path").openConnection() as HttpURLConnection try { conn.requestMethod = method conn.setRequestProperty("X-Junco-Player", playerId(ctx)) if (body != null) { conn.doOutput = true conn.setRequestProperty("Content-Type", "application/json") conn.outputStream.use { it.write(body.toString().toByteArray()) } } val ok = conn.responseCode in 200..299 val text = (if (ok) conn.inputStream else conn.errorStream)?.bufferedReader()?.use { it.readText() } ?: "{}" val json = runCatching { JSONObject(text) }.getOrDefault(JSONObject()) if (!ok) throw IOException(json.optString("error", "Couldn't reach support. Try again in a moment.")) json } finally { conn.disconnect() } } /** type: "bug", "idea" or "help" */ suspend fun report(ctx: Context, type: String, text: String, screen: String): JSONObject { val info = ctx.packageManager.getPackageInfo(ctx.packageName, 0) val context = JSONObject() .put("version", info.versionName) .put("android", Build.VERSION.RELEASE) .put("device", "${Build.MANUFACTURER} ${Build.MODEL}") .put("screen", screen) .put("language", java.util.Locale.getDefault().toLanguageTag()) return call(ctx, "/tickets", "POST", JSONObject().put("type", type).put("text", text).put("context", context)) } suspend fun tickets(ctx: Context) = call(ctx, "/tickets").getJSONArray("tickets") suspend fun ticket(ctx: Context, number: Int) = call(ctx, "/tickets/$number") suspend fun reply(ctx: Context, number: Int, text: String) = call(ctx, "/tickets/$number/messages", "POST", JSONObject().put("text", text)) suspend fun unread(ctx: Context) = call(ctx, "/unread").getInt("count") } ``` Needs the `INTERNET` permission in your manifest. ### Flutter (Dart) Uses the `http` and `shared_preferences` packages. ```dart import 'dart:convert'; import 'dart:math'; import 'package:http/http.dart' as http; import 'package:shared_preferences/shared_preferences.dart'; class Junco { static const server = 'https://desk.juncodesk.app'; static const key = 'jk_YOUR_PUBLIC_KEY'; static Future _playerId() async { final prefs = await SharedPreferences.getInstance(); var id = prefs.getString('junco_player'); if (id == null || id.length < 32) { final r = Random.secure(); id = List.generate(24, (_) => r.nextInt(256).toRadixString(16).padLeft(2, '0')).join(); await prefs.setString('junco_player', id); } return id; } /// Throws an Exception whose message you can show the user. static Future> _call(String path, {String method = 'GET', Map? body}) async { final uri = Uri.parse('$server/v1/games/$key$path'); final headers = {'X-Junco-Player': await _playerId(), if (body != null) 'Content-Type': 'application/json'}; final res = switch (method) { 'POST' => await http.post(uri, headers: headers, body: jsonEncode(body)), 'DELETE' => await http.delete(uri, headers: headers), _ => await http.get(uri, headers: headers), }; final data = res.body.isEmpty ? {} : jsonDecode(res.body) as Map; if (res.statusCode >= 300) throw Exception(data['error'] ?? "Couldn't reach support. Try again in a moment."); return data; } /// type: 'bug', 'idea' or 'help' static Future> report(String type, String text, Map context) => _call('/tickets', method: 'POST', body: {'type': type, 'text': text, 'context': context}); static Future> tickets() async => (await _call('/tickets'))['tickets'] as List; static Future> ticket(int number) => _call('/tickets/$number'); static Future> reply(int number, String text) => _call('/tickets/$number/messages', method: 'POST', body: {'text': text}); static Future unread() async => (await _call('/unread'))['count'] as int; } ``` Flutter **web** builds run in a browser, so they send an `Origin` header: list the site's address on the product in Junco, or use the widget. ### React Native and Expo `fetch` is built in; the id uses `expo-crypto` and `@react-native-async-storage/async-storage`. ```js import AsyncStorage from "@react-native-async-storage/async-storage"; import * as Crypto from "expo-crypto"; import { Platform } from "react-native"; const SERVER = "https://desk.juncodesk.app"; const KEY = "jk_YOUR_PUBLIC_KEY"; async function playerId() { let id = await AsyncStorage.getItem("junco.player"); if (!id || id.length < 32) { id = Array.from(Crypto.getRandomBytes(24), (b) => b.toString(16).padStart(2, "0")).join(""); await AsyncStorage.setItem("junco.player", id); } return id; } async function call(path, { method = "GET", body } = {}) { const res = await fetch(`${SERVER}/v1/games/${KEY}${path}`, { method, headers: { "X-Junco-Player": await playerId(), ...(body ? { "Content-Type": "application/json" } : {}) }, body: body ? JSON.stringify(body) : undefined, }); const data = await res.json().catch(() => ({})); if (!res.ok) throw new Error(data.error ?? "Couldn't reach support. Try again in a moment."); return data; } export const Junco = { // type: "bug", "idea" or "help" report: (type, text, context = {}) => call("/tickets", { method: "POST", body: { type, text, context: { os: `${Platform.OS} ${Platform.Version}`, ...context } } }), tickets: async () => (await call("/tickets")).tickets, ticket: (number) => call(`/tickets/${number}`), reply: (number, text) => call(`/tickets/${number}/messages`, { method: "POST", body: { text } }), unread: async () => (await call("/unread")).count, deleteEverything: () => call("/me", { method: "DELETE" }), }; ``` For a screenshot, send `FormData` with a `ticket` field (the JSON as a string) and `{ uri, name: "screenshot.jpg", type: "image/jpeg" }` as `screenshot`, without setting `Content-Type` yourself. ### Desktop apps and servers (any language) Any HTTP client works the same way: the base address, the `X-Junco-Player` header (or a signed token), JSON in and out. From a terminal: ```sh ID=$(head -c 24 /dev/urandom | base64 | tr '+/' '-_' | tr -d '=') curl -s -X POST https://desk.juncodesk.app/v1/games/jk_YOUR_PUBLIC_KEY/tickets \ -H "X-Junco-Player: $ID" \ -F 'ticket={"type":"bug","text":"The export button does nothing","context":{"version":"2.1.0"}}' \ -F 'screenshot=@shot.png' curl -s https://desk.juncodesk.app/v1/games/jk_YOUR_PUBLIC_KEY/tickets -H "X-Junco-Player: $ID" ``` Electron and Tauri apps that load an `https://` site can use the widget there; apps that load local files can't (Junco only allows `https://` web addresses), so use this API from the main process, or the hosted page. ## Showing replies Users only see replies where you show them. A simple pattern: 1. When the app starts or comes back to the front, call `GET /unread` and put the count on your Support button. 2. The Support screen lists `GET /tickets` (newest activity first; `unread` marks new replies). 3. Opening one calls `GET /tickets/`, which marks it read. While `aiWorking` is true, call it again every 2 seconds (stop after about 90 seconds): the AI's reply is on its way. Rate limits are generous for this: 300 reads a minute per address. All of them: [Limits](/docs/limits). --- # Signed user tokens > **In short.** Optional. If your users sign in, your server signs a short JWT for each one with an > Ed25519 private key (`alg: "EdDSA"`) and claims `sub` (your user id), `name` (optional), `aud` > (the product's `jk_...` key) and `exp` (at most 7 days ahead). The widget sends it as > `Authorization: Bearer `. Their tickets then follow their account to any device. The > private key stays on your server; Junco only has the public half. Without tokens, Junco recognises users by a random id kept in their browser or app, which is fine for many products. Use tokens when users sign in and switch devices, or when you want only signed-in users to reach support. ## 1. Make a key pair On the product's page in Junco: **How users are recognised → Make a key**. Your browser makes an Ed25519 key pair and downloads the private half as `-junco-signing-key.pem` (PKCS#8, `-----BEGIN PRIVATE KEY-----`). Junco keeps only the public half and can't show the private half again. Keep the `.pem` **on your server only**, in a secret or environment variable (`JUNCO_SIGNING_KEY`, with its line breaks). Never put it in your app, your website's code or your repo. Making a new key stops tokens signed with the old one at once. On the same page, **Without an account** says whether users without a token may still send tickets (by their random id). Turn it off to take tickets from signed-in users only. ## 2. Sign a token on your server The token is a compact JWT: | Part | Value | |---|---| | Header | `{"alg": "EdDSA", "typ": "JWT"}` | | `sub` | Your id for the user: any string, 1 to 200 characters. Use something stable, not an email. | | `name` | Their display name, shown to your team (optional; cut to 40 characters). | | `aud` | The product's public key, `jk_...`. A token for one product doesn't work for another. | | `exp` | When it expires, in seconds since 1970: in the future, and at most 7 days ahead. | | `iat` | Optional, ignored. | Junco rejects a token with another `alg`, a bad signature, the wrong `aud`, or an `exp` in the past or more than 7 days ahead. A day (`86400` seconds) is a good lifetime; the widget asks for a fresh one before each request. ### Node.js (no packages) ```js import { createPrivateKey, sign } from "node:crypto"; const key = createPrivateKey(process.env.JUNCO_SIGNING_KEY); const b64 = (v) => Buffer.from(typeof v === "string" ? v : JSON.stringify(v)).toString("base64url"); export function juncoToken(user) { const head = b64({ alg: "EdDSA", typ: "JWT" }); const body = b64({ sub: String(user.id), name: user.displayName, aud: "jk_...", exp: Math.floor(Date.now() / 1000) + 86400 }); return `${head}.${body}.${sign(null, Buffer.from(`${head}.${body}`), key).toString("base64url")}`; } // Express: app.get("/api/junco-token", requireLogin, (req, res) => res.type("text").send(juncoToken(req.user))); ``` With `jose`: `await new SignJWT({ name }).setProtectedHeader({ alg: "EdDSA" }).setSubject(id).setAudience("jk_...").setExpirationTime("1d").sign(await importPKCS8(pem, "EdDSA"))`. ### Python (PyJWT) ```python # pip install "pyjwt[crypto]" import os, time, jwt KEY = os.environ["JUNCO_SIGNING_KEY"] def junco_token(user) -> str: claims = {"sub": str(user.id), "name": user.display_name, "aud": "jk_...", "exp": int(time.time()) + 86400} return jwt.encode(claims, KEY, algorithm="EdDSA") # Flask: @app.get("/api/junco-token") -> return junco_token(current_user), 200, {"Content-Type": "text/plain"} # Django: return HttpResponse(junco_token(request.user), content_type="text/plain") ``` ### Go (standard library only) ```go package junco import ( "crypto/ed25519" "crypto/x509" "encoding/base64" "encoding/json" "encoding/pem" "os" "time" ) var key = func() ed25519.PrivateKey { block, _ := pem.Decode([]byte(os.Getenv("JUNCO_SIGNING_KEY"))) if block == nil { panic("JUNCO_SIGNING_KEY isn't a PEM key") } k, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { panic(err) } return k.(ed25519.PrivateKey) }() func b64(v any) string { b, _ := json.Marshal(v) return base64.RawURLEncoding.EncodeToString(b) } func Token(userID, name string) string { head := b64(map[string]string{"alg": "EdDSA", "typ": "JWT"}) body := b64(map[string]any{"sub": userID, "name": name, "aud": "jk_...", "exp": time.Now().Add(24 * time.Hour).Unix()}) sig := ed25519.Sign(key, []byte(head+"."+body)) return head + "." + body + "." + base64.RawURLEncoding.EncodeToString(sig) } ``` ### PHP (sodium, built in since PHP 7.2) ```php rtrim(strtr(base64_encode($v), '+/', '-_'), '='); $head = $b64(json_encode(['alg' => 'EdDSA', 'typ' => 'JWT'])); $body = $b64(json_encode(['sub' => $userId, 'name' => $name, 'aud' => 'jk_...', 'exp' => time() + 86400])); return "$head.$body." . $b64(sodium_crypto_sign_detached("$head.$body", $secret)); } ``` ### Anything else Any JWT library that supports **EdDSA with Ed25519** works: `jose` (JavaScript), `PyJWT` with `cryptography` (Python), `golang-jwt` (Go), `jwt` with `ed25519` (Ruby), `NSec` or BouncyCastle (.NET), `jjwt` or Nimbus (Java and Kotlin), `jsonwebtoken` (Rust). If yours wants a raw key rather than PEM, the 32-byte seed is the last 32 bytes of the PEM's decoded contents. ## 3. Hand it to the form **The widget:** add an endpoint that returns the token as plain text for the signed-in user (and an error, or nothing, for everyone else), and pass a function: ```js Junco.init({ game: "jk_...", server: "https://desk.juncodesk.app", playerToken: () => fetch("/api/junco-token", { credentials: "include" }).then((r) => (r.ok ? r.text() : null)), }); ``` The widget calls it before each request, so keep it quick (cache the token in memory until shortly before `exp` if your endpoint is slow). Returning `null` falls back to the random id, if **Without an account** is on. **Your own form (the API):** send `Authorization: Bearer ` instead of `X-Junco-Player`. Native apps get the token from your backend the same way. ## Check a token Paste it into any JWT decoder: the header must say `EdDSA`, `aud` must be the product's key, and `exp` must be within 7 days. Then: ```sh curl -s https://desk.juncodesk.app/v1/games/jk_.../unread -H "Authorization: Bearer $TOKEN" # {"count":0} good # {"error":"Player token isn't valid"} wrong key, aud or exp # {"error":"This game doesn't use player tokens"} no key made on the product yet ``` --- # Using the desk > **In short.** The desk is Junco's web app for your team, at `https://desk.juncodesk.app`, built for phones first. > The **Inbox** sorts tickets by stage; **Needs you** is the only tab you have to clear. Open a > ticket to read the thread, the AI's notes and the product's context, then reply, add an internal > note, change status or priority, or make a GitHub issue. Sign-in is by passkey only. ## Signing in - **Passkeys only**: Face ID, a fingerprint, Windows Hello, or a passkey manager (iCloud Keychain, Google Password Manager, 1Password). There are no passwords. - You join from an **invite link** (one use, 7 days). To use another device, sign in on one that has your passkey and choose **Settings → Passkeys → Add a passkey on this device**, or use a passkey that syncs. - **Settings → Signed-in devices** lists your sessions; sign any of them out. - Add the desk to your phone's home screen (Share → Add to Home Screen, or Install app) and it opens like an app. ## The inbox Tabs, with counts: | Tab | What's there | |---|---| | **Needs you** | Tickets a person must act on: the AI handed them over, held its reply, the AI was paused, or a user wrote again on a ticket that's with you. **Clear this one.** | | **AI handling** | The AI answered and is looking after it. Read when you like; step in any time. | | **Waiting on user** | You asked the user something. | | **In progress** | A GitHub issue is open for it. | | **Awaiting release** | Fixed (the issue closed as completed); users were told it's coming in the next update. | | **Resolved** | Done. A reply from the user reopens it. | | **All** | Everything. | Each row shows the title (the AI's), the product (when you have more than one), type, status, priority and how many reports are grouped with it. Unread tickets have a dot. The list updates live. On a wide screen (1100 pixels and up) the inbox and the open ticket sit side by side. Keys: **J** and **K** (or the arrow keys in the list) move between tickets, **Esc** closes the ticket. ## A ticket - **The thread**: the user's messages, replies from the AI and your team, and internal notes (yellow, never shown to the user). - **AI triage**: what the AI made of it: area, severity, confidence, why it needs a person, its internal note, and its reply with whether it was sent, held for you or discarded. - **Context**: what the product sent (version, screen, device…), the screenshot, save and log, whether the user was signed in, and when they first wrote. - **Similar reports**: other tickets in the same group. **Not the same problem** takes one out; "Same problem as…" links one in. Resolving the first ticket resolves the whole group. - **Timeline**: every change, by whom (you, the AI, the user, Junco). What you can do: | Action | Does | |---|---| | **Reply to user** | Sends your message; it shows in their form as from "the team". | | **Internal note** | For your team only. | | **A held AI reply** | **Send as it is**, **Edit** it then send, or **Discard** it. | | **Status** | Move it between stages; **Resolve**, **Reopen**. | | **Priority** | Low, Medium, High, Critical. | | **The AI can answer it** | Hand a ticket back to the AI. | | **Create issue** | With GitHub connected: the AI drafts an issue from every report in the group for you to edit and create ([GitHub and releases](/docs/github)). | | **Download their data / Delete their data** | Admins only: everything Junco holds about this user, as JSON, or delete it all ([Your users' data](/docs/data)). | ## Alerts The **Alerts** page sets what reaches your phone, per person: - **Tell me when**: a ticket is escalated to me; critical bugs (straight away, even in quiet hours); the same thing from several users in an hour (a surge, 5 by default); the AI's reply was held; a user replied on a ticket that's with me; a morning digest; every new ticket (noisy, off by default). - **Quiet hours** (23:00 to 07:00 by default, in your time zone) and the digest time. - **Send to**: your phone through the free **ntfy** app, on your own topic. Install ntfy, subscribe to the topic shown, and use **Send a test alert**. Every alert is also listed on the Alerts page. ## Other pages | Page | For | |---|---| | **Get started** | A checklist that ticks itself off as you set up. | | **Products** | Each product: its public key, web addresses, how users are recognised, Install, the hosted page, GitHub, your privacy policy's address. | | **Knowledge** | What the AI knows about each product ([Teaching the AI](/docs/knowledge)). | | **Ideas** | Feature ideas from users, counted and merged ("12 users asked for this"), with ideas you add yourself. Only your team sees it. | | **Releases** | Fixes waiting to go out; release them, and make release keys for deploy scripts. | | **AI** | Spend and credit, switches, caps and holding replies ([Pricing and AI credit](/docs/pricing)). | | **Settings** | Appearance (match device, light or dark; per device), AI replies, GitHub, your devices and passkeys, the team, the legal documents. | ## Your team **Settings → Team** (admins): invite people by email (you copy and send the link; it lasts 7 days), choose **Admin** or **Member**, take back an invite, remove someone (they're signed out everywhere). | | Admin | Member | |---|---|---| | Work the inbox, reply, notes, issues, releases, ideas, knowledge | Yes | Yes | | The AI page: switches, caps, holding replies, buying credit | Yes | Yes | | Adding and changing products, connecting GitHub, the team | Yes | No | | Download or delete a user's data | Yes | No | Your studio may have a seat limit; invites count towards it. --- # How the AI works > **In short.** Every new ticket goes to an AI model (Google Gemini Flash, through OpenRouter) > with your product's knowledge and personal details removed. It sorts the ticket, checks for > duplicates, writes a reply and says whether a person is needed. The reply goes to the user only > if it passes rules in code **and** a second model's checklist; otherwise it's held for you and > the user is told a person will reply. Money, accounts, bans, safety and reports about other users > always go to a person. ## Step by step 1. **A ticket arrives.** The user's text, the product's context and the names of any files. 2. **Personal details come out.** Emails, phone numbers, postcodes and street addresses, card numbers, IP addresses, real names and anything that looks like a password or key are replaced with placeholders such as `[EMAIL_1]`. The model never sees the originals. 3. **Possible duplicates are found** by a small embedding model that runs on Junco's own server (no third party): the closest earlier reports for the same product. 4. **The model triages.** It reads your product's knowledge, the ticket and the possible duplicates, and answers in a fixed shape (checked in code): | Field | Meaning | |---|---| | `type` | Bug, idea or help. | | `title` | A short title for the inbox. | | `area` | Which part of the product, from your knowledge's **Areas**. | | `severity` | Low, medium, high or critical. | | `confidence` | 0 to 1. | | `needsHuman` and why | Whether a person must act, with reasons from the list below. | | `reply` | The message to the user, in their language. | | `makesPromise` | Whether the reply promises anything. | | `internalNote` | For your team: what's wrong, likely cause, what to check. | | `duplicateOf` | The earlier report it's the same problem as, if any. Junco groups them. | 5. **The reply is checked** (below). It's sent, or held for a person. 6. **The ticket lands** in **AI handling** if the AI dealt with it, or **Needs you** if a person is needed, with an alert if your alert settings say so. The whole thing usually takes 3 to 8 seconds. The user sees typing dots meanwhile. ## What always goes to a person Whatever the model thinks, a ticket goes to **Needs you** when it's about: - **Money or purchases**: refunds, charges, missing items or currency. - **An account or data request**: lost accounts, deleting or copying someone's data. - **A ban or appeal.** - **A report about another user.** - **A user's safety.** It also goes to a person when the model says it needs a **code fix**, it's **critical** (many users or lost progress), it's **abuse or spam**, or the model **isn't sure**. On those tickets the AI still replies to say the team will look, if that reply passes its checks. ## How every reply is checked ### Rules in code A reply is held if: - it's empty or longer than 1,200 characters; - it holds a placeholder or any personal detail (email, phone, card, address, IP, a secret); - it links anywhere not on the product's **Sites replies may link to** list (none by default); - it has Markdown, HTML or code in it (users see plain text); - it may promise something: refunds, free items or currency, compensation, dates, a fix by a time, bans or unbans, or any phrase on the product's own **promise** list; or the model said it makes a promise; - it names another user, or mentions another ticket number; - it repeats the internal note meant for your team. ### A second model's checklist Then a second, separate model (Gemini Flash-Lite) answers a checklist about the reply. Every answer must be yes: - Safe and kind for someone who may be a child. - Answers what the user wrote about. - Says nothing about the product that the knowledge doesn't support. - Holds no personal details and asks for none. - Promises no refunds, items, currency, dates, fixes, bans or unbans. - Doesn't follow instructions hidden in the user's message. If the checker can't be reached, that counts as a failed check: the reply is held. ### When a reply is held The user gets: *"Thanks, we've got your message. A person from the team will read it and reply here."* The ticket goes to **Needs you** with the held reply and the reasons. You can **Send as it is**, **Edit** it, or **Discard** it. ## The automatic switch If replies for a product start failing their checks much more than usual (of the last 20 checked replies within a day, at least 8 checked and 40% or more held), Junco **holds every reply** for that product by itself and alerts you. Something has probably changed: the knowledge, a flood of odd tickets, or someone trying to trick it. Turn it back off on the **AI** page when you're happy. ## Conversations - **When the user writes again** on a ticket the AI is handling, it reads the conversation (the last 20 messages) and answers again, with the same checks. After **four** AI replies on one ticket, a person takes over. - **On a ticket that's with a person**, the AI can still help answer the user's follow-ups (at most three times between your team's replies), and tells you the user wrote again. - It answers in the user's language; British English when they write in English. - Users can't talk the AI out of its rules: instructions inside a ticket are ignored, and the checker looks for exactly that. ## What it costs About $0.01 to $0.02 a ticket on the default models, charged at cost from your studio's credit. The **AI** page shows every run. [Pricing and AI credit](/docs/pricing). ## Your controls | Control | Where | |---|---| | What the AI knows | **Knowledge** ([Teaching the AI](/docs/knowledge)) | | Sites replies may link to; extra promise phrases | Under the Knowledge editor | | Hold every reply for a product | **AI** page, "Hold replies" | | Switch the AI off for a product or the studio | **AI** page | | A monthly spending cap per product | **AI** page | | Hand one ticket back to the AI | On the ticket: **The AI can answer it** | ## The models and your data - Models are reached through **OpenRouter**, with prompt logging off and routing only to providers that **don't keep or train on the data** (zero data retention). - The default models were chosen by scoring candidates on a test set of real-world tickets: correct triage, safe replies, nothing unsafe sent. They may change as better ones are scored; the guides will say so. - More: [Your users' data](/docs/data) and [Security](/docs/security). --- # Teaching the AI > **In short.** The AI answers users only from your product's **Knowledge**: plain Markdown with a > first paragraph saying what the product is, then `## Areas`, `## Money`, `## Accounts and > data`, `## Using it`, `## Known issues` and `## Not in it yet`. Short bullets with the exact > names of buttons and screens. Under about 15,000 characters, as it's read for every ticket. Junco's AI answers your users **only** from your product's knowledge. If something isn't there, it says it doesn't know and passes the ticket to you. So the knowledge is the most important thing you set up, and worth keeping up to date. ## Getting a first version On the **Knowledge** page: - **From your help text.** Paste an FAQ, README, help page or your own notes; the AI rewrites it in the shape below for you to check. (It's charged to your AI credit, usually a cent or two.) - **From your code, with your AI.** Copy the prompt into your coding AI inside your project. It reads the code and writes the knowledge for you to paste in. (The Knowledge page gives you the same prompt with your product's name in it.) ```prompt Write a support knowledge file for your product, for Junco: an AI support agent that answers our users using only this file. It has no other knowledge of the product, so anything missing here, it will say it doesn't know and pass to me. Read the codebase (and any README, docs, FAQ or changelog in it) and write Markdown, under 20,000 characters, in this shape: - A first paragraph: what your product is, who it's for, where it runs (web, phone, desktop), who makes it. - ## Areas: the main parts of the product, one line, separated by " · " (the AI files each ticket under one). - ## Money: anything users pay for, and that support can't give refunds, credit or items (a person handles those). - ## Accounts and data: how users sign in, where their data or progress is saved, how to back it up or move devices, what can't be recovered. - ## Using it: short how-tos for the things users most often ask, as bullet points with exact names of buttons and screens. - ## Known issues: bugs we know about, with any workaround. - ## Not in it yet: things users ask for that don't exist, so the AI doesn't invent them. Plain facts, short bullets, exact names from the UI. No marketing, no guesses: if you're not sure, leave it out. Format guide: https://desk.juncodesk.app/docs/knowledge.md Give me the file to paste into Junco (Knowledge page). ``` Either way, **read every line before saving**: the AI will repeat it to users as fact. ## The shape that works best ```markdown Moth Quest is a puzzle game for phones and browsers, made by Moth Games. ## Areas Levels · Shop · Accounts · Saves · Sound · Other ## Money - Gems are bought with real money. Refunds and purchases are handled by a person. - Support can't give gems or items. ## Accounts and data - Progress is saved to your account; sign in on a new phone to get it back. ## Using it - Hints: tap the bulb, top right. Three free hints a day. ## Known issues - Level 42 can freeze on older iPhones. Workaround: turn off Effects in Settings. ## Not in it yet - There's no multiplayer, and no date for it. ``` - **Areas** are what the AI files each ticket under, so you can see where problems cluster. - **Known issues** with workarounds save you the most tickets. - **Not in it yet** stops the AI inventing features. - Use the exact names of buttons and screens. Short bullets beat paragraphs. - It's read for every ticket, so shorter is cheaper: under 15,000 characters is plenty. ## What replies may hold Under the editor: - **Sites replies may link to**: your own help pages. A reply with any other link waits for you. - **More phrases that count as promises**: words specific to your product, on top of the usual ones (refunds, free items, fix dates). A reply that promises something waits for you. Money, accounts, bans and reports about other users always go to a person, whatever the knowledge says. --- # GitHub and releases > **In short.** Optional. Connect a product to a GitHub repo through Junco's GitHub App (issues > only). **Create issue** on a ticket makes one issue from the whole group of reports, drafted by > the AI without personal details. Closing it as completed tells users a fix is coming; a GitHub > release, the Releases page or `POST /v1/releases` from a deploy script tells them it's live. Connect a product to its GitHub repo to make issues from tickets and to tell users when their fix is live. ## Connecting On the product's page, **GitHub → Connect GitHub**: 1. GitHub asks where to install **Junco's app**. Pick the account and the repos it may use. It asks only for issues (read and write) and the repo's basic details. 2. You sign in with GitHub, so Junco can check those installations are really yours. 3. Back in Junco, pick the repo for this product. Only admins can connect GitHub. A repo not in the list? Use **Add it on GitHub** to give the app access to more repos. ## Issues from tickets On a ticket (or an idea), **Create issue**. The AI drafts the issue from every report of the same problem: steps to reproduce, what was expected, the version and device. It never includes users' personal details. You can edit it before it goes. The issue is labelled `bug` or `idea` and `from-junco`. Later reports of the same thing add a comment to the issue, not a new one. When the issue is **closed as completed**, its tickets move to **Awaiting release** and the users are told the fix is coming in the next update. Closed as not planned, the tickets come back to you and users aren't told. ## Releases When the new version is out, its fixed tickets move to **Released** and each user is told. Three ways, use whichever suits: - **A GitHub release** (on by default once connected): publishing a release on the repo releases every fixed ticket, named after the release's tag. Drafts and pre-releases don't count. Turn it off on the product's page. - **By hand**: the **Releases** page lists everything waiting; pick some or all. - **From your deploy script**: make a release key on the **Releases** page, then: ```sh curl -X POST https://desk.juncodesk.app/v1/releases \ -H "Authorization: Bearer $JUNCO_RELEASE_KEY" \ -H "Content-Type: application/json" \ -d '{"version": "1.4.2"}' ``` Add `"issues": [12, 15]` to release only the fixes from those GitHub issues. --- # API reference > **In short.** Base address `https://desk.juncodesk.app/v1/games/`. Say who the user is on every call > with `Authorization: Bearer ` or `X-Junco-Player: `. JSON in and out; > files by `multipart/form-data`. Errors are `{"error": "..."}` with words you can show the user. > A user only ever sees their own tickets. Machine-readable: `https://desk.juncodesk.app/openapi.json` (OpenAPI 3.1). This is the API Junco's own widget uses. Use it to build your own support form in a game engine, a native app or a server. There's no API key: the public key names the product, and the user is identified as below. ## Who the user is Every request carries one of: - **A signed token**, for users who sign in: `Authorization: Bearer `, a JWT your server signs with the product's Ed25519 key. See [Signed user tokens](/docs/user-tokens). - **A random id**, for everyone else: `X-Junco-Player: `, 32 to 128 characters from `A-Z a-z 0-9 _ -`, made once per install or browser and kept. Losing it loses access to that user's old tickets. Allowed only while the product's **Without an account** setting is on. If both are sent, the token is used. ## Browsers and CORS Calls from a web page carry an `Origin` header, which must be one of the product's web addresses in Junco (or Junco's own hosted page while that's on); otherwise 403. Junco answers preflight `OPTIONS` requests for `GET`, `POST` and `DELETE` with the headers `Authorization`, `Content-Type` and `X-Junco-Player`. Native apps, engines and servers send no `Origin` and need nothing listed. Don't send cookies; Junco doesn't use them here. ## Endpoints | Method and path | Does | Success | |---|---|---| | `POST /tickets` | Raise a ticket | `201` ticket with messages | | `GET /tickets` | The user's tickets | `200` `{"tickets": [...]}` | | `GET /tickets/{number}` | One ticket and its messages; marks it read | `200` ticket with messages | | `POST /tickets/{number}/messages` | The user replies; reopens a closed ticket | `201` ticket with messages | | `GET /unread` | How many tickets have replies the user hasn't read | `200` `{"count": 2}` | | `DELETE /me` | Delete everything this user has sent | `200` `{"deleted": {"tickets": 3, "files": 1}}` | | `POST https://desk.juncodesk.app/v1/releases` | Tell users their fixes are live (deploy scripts) | `201` `{"released": 4, "version": "1.4.2"}` | ### Raise a ticket: `POST /tickets` JSON body: | Field | Type | Required | Notes | |---|---|---|---| | `type` | `"bug"`, `"idea"` or `"help"` | yes | What the user chose. | | `text` | string | yes | What they wrote, 1 to 5,000 characters. | | `title` | string | no | Up to 140 characters. Without one, Junco makes one from the first line, and the AI may improve it. | | `handle` | string | no | The user's display name for your team, up to 40 characters. A token's `name` wins. | | `context` | object | no | Anything useful: version, screen, device, settings. Up to 16 KB as JSON. No personal details. | ```sh curl -s -X POST https://desk.juncodesk.app/v1/games/jk_YOUR_KEY/tickets \ -H "Content-Type: application/json" \ -H "X-Junco-Player: 7kQ2mVx9pL4rT8wN3bY6cH1jF5sD0aZe" \ -d '{"type":"bug","text":"The map is blank after I dock at Ilse Strand.","context":{"version":"0.9.2","screen":"Map","device":"iPhone 15, Safari"}}' ``` ```json { "number": 42, "type": "bug", "status": "ai_handling", "stage": "ai_handling", "title": "The map is blank after I dock at Ilse Strand.", "createdAt": "2026-11-24T21:14:03.120Z", "lastMessageAt": "2026-11-24T21:14:03.120Z", "unread": false, "messages": [ { "id": "5f0c…", "from": "player", "text": "The map is blank after I dock at Ilse Strand.", "at": "2026-11-24T21:14:03.120Z" } ], "aiWorking": true } ``` `aiWorking: true` means the AI is writing a reply: fetch the ticket again every couple of seconds until it's false. A ticket's `number` is per product, and is how you refer to it afterwards. **With files**, send `multipart/form-data`: a `ticket` field holding the JSON above as text, plus up to three files: | Field | Accepts | Up to | |---|---|---| | `screenshot` | PNG, JPEG or WebP (checked from the bytes) | 2 MB | | `save` | Anything; kept as a download | 1 MB | | `log` | UTF-8 text, no NUL bytes | 512 KB | At most 4 MB a request. Any other field name is refused. ```sh curl -s -X POST https://desk.juncodesk.app/v1/games/jk_YOUR_KEY/tickets \ -H "X-Junco-Player: $ID" \ -F 'ticket={"type":"bug","text":"Crashed when I opened the hangar"}' \ -F 'screenshot=@crash.jpg' -F 'log=@game.log' ``` ### List: `GET /tickets` The user's tickets for this product, newest activity first, without messages: ```json { "tickets": [ { "number": 42, "type": "bug", "status": "resolved", "stage": "released", "title": "Blank map after docking", "createdAt": "…", "lastMessageAt": "…", "unread": true } ] } ``` ### One ticket: `GET /tickets/{number}` The same as the answer to raising a ticket, with every message the user can see (never your team's internal notes). Marks the ticket read. Another user's ticket number answers 404. Messages have `from`: `"player"` (the user), `"ai"` or `"staff"` (your team; never a name), `text` (plain text) and `at` (ISO 8601). ### Reply: `POST /tickets/{number}/messages` Body `{"text": "Still blank after the update"}` (1 to 5,000 characters). Answers `201` with the ticket. Reopens a resolved or released ticket; the AI answers if it's handling the ticket, and your team is alerted if it's with them. ### Unread: `GET /unread` `{"count": 2}`: tickets with replies the user hasn't opened. For a badge on your Support button. ### Delete everything: `DELETE /me` Deletes every ticket, message and file this user has sent to this product. Can't be undone. Offer it in your settings with a confirm, as the widget does. ## Statuses Each ticket has `stage`, the full status, and `status`, one of the first four for older clients: | `stage` | `status` | Tell the user | |---|---|---| | `ai_handling` | `ai_handling` | Being looked at | | `needs_you` | `needs_you` | With the team | | `waiting_on_player` | `waiting_on_player` | Waiting for you: reply when you can | | `in_progress` | `needs_you` | Being worked on | | `awaiting_release` | `needs_you` | Fixed: coming in the next update | | `resolved` | `resolved` | Resolved: reply if it's still a problem | | `released` | `resolved` | Fixed and live | Read `stage` and fall back to `status`; treat a value you don't know as "With the team". ## Releases: `POST /v1/releases` From a deploy script, after a new version is live. Every ticket waiting for a release (its GitHub issue was closed as completed) moves to **Released**, and each user is told in their thread. ```sh curl -s -X POST https://desk.juncodesk.app/v1/releases \ -H "Authorization: Bearer $JUNCO_RELEASE_KEY" \ -H "Content-Type: application/json" \ -d '{"version": "1.4.2"}' ``` | Field | Notes | |---|---| | `version` | Optional, up to 40 characters of letters, digits, `.`, `_`, `+`, `-` and spaces. Shown to users. | | `issues` | Optional: only the fixes from these GitHub issue numbers, e.g. `[12, 15]`. Up to 200. | The release key (`jr_...`) is made on the desk's **Releases** page and names the product. It's a secret: keep it in your CI's secrets. With GitHub connected you may not need this at all: publishing a GitHub release does the same ([GitHub and releases](/docs/github)). ## Errors Every error is JSON: `{"error": "..."}`. The words are safe to show users. | Status | When | |---|---| | `400` | A field is missing or wrong (the message names it, e.g. `text: Too small`), unexpected form field, bad JSON. | | `401` | `Missing player`, `This game needs a player token`, `Player token isn't valid`, `This game doesn't use player tokens`, or a bad random id. | | `403` | `This page isn't allowed to use this game's support`: a browser `Origin` that isn't listed. | | `404` | `Unknown game` (the public key), `No such ticket`. | | `413` | `That's too big to send`, `Game context is too big`, `The screenshot is too big`. | | `415` | `Send JSON or multipart form data`, `The screenshot isn't a file type Junco accepts`. | | `429` | `Too many messages from you. Try again in 120 s.` with a `Retry-After` header in seconds. | | `500` | `Something went wrong`. Try again later. | Every message and its fix: [Troubleshooting](/docs/troubleshooting). Every limit: [Limits](/docs/limits). ## Not in the API - There's no API for your team's side (reading the inbox, replying as staff): that's the desk. - No webhooks out of Junco yet. Users' replies arrive in your form when you fetch them. - No pagination: a user's own ticket list is short. --- # Limits and numbers > **In short.** Every number in Junco that you might hit, in one place. ## What users send | Limit | Value | |---|---| | Message text | 1 to 5,000 characters | | Ticket title | 140 characters | | Display name (`handle`, a token's `name`) | 40 characters | | `context` | 16 KB as JSON | | Screenshot | PNG, JPEG or WebP, 2 MB | | Save | 1 MB, any format | | Log | 512 KB, UTF-8 text | | Files a request | 3 | | Whole request | 4 MB | ## Rates Per 10 minutes, counted on the server; over a limit answers `429` with `Retry-After`: | Who | Writes (new tickets, replies) | |---|---| | One user of one product | 20 | | One network address | 60 | | One product, all users | 2,000 | Reads (`GET`): 300 a minute per network address. ## Identity | | | |---|---| | Random user id (`X-Junco-Player`) | 32 to 128 characters, `A-Z a-z 0-9 _ -` | | Signed token lifetime (`exp`) | At most 7 days ahead | | Token `sub` | 1 to 200 characters | | Signing algorithm | EdDSA (Ed25519) only | ## Products | | | |---|---| | Web addresses per product | 20; `https://` only, `http://` for `localhost` and `127.0.0.1` | | Knowledge | Keep under about 15,000 characters: it's read for every ticket | | AI reply length | 1,200 characters (longer is held) | | AI replies on one ticket before a person takes over | 4 | | AI answers between your team's replies, on a ticket with a person | 3 | ## Your team | | | |---|---| | Invite links | One use, 7 days | | Studios per person | 1, for now | | Seats | Unlimited unless your studio has a seat limit | | One-time sign-in links (when moving devices or addresses) | 30 minutes | ## Keeping data | | | |---|---| | Screenshots, saves and logs | Deleted after 90 days | | Resolved and released tickets | Deleted a year after their last message | | Users with nothing left who haven't been back | Deleted after a year | | Encrypted backups | Up to 12 months | ## Money | | | |---|---| | Starting credit | $2 | | Credit packs | $10, $25, $50, $100 | | Top-up fee | 10% | | Smallest monthly cap per product | $0.50 | | A typical ticket | $0.01 to $0.02 at cost | ## Timing | | | |---|---| | The AI's first reply | Usually 3 to 8 seconds | | Widget checks for replies | Every minute; every 10 s in an open thread; every 1.5 s while the AI writes (for 90 s) | | GitHub issues checked for changes | Every 10 minutes, and at once by webhook | | Widget script cache | 5 minutes | --- # Troubleshooting > **In short.** Find the exact message below. Most problems are one of three: the page's web > address isn't listed on the product, a Content Security Policy blocks `https://desk.juncodesk.app`, or the > product wants signed-in users and no token was sent. ## The form doesn't appear | Symptom | Cause | Fix | |---|---|---| | No round button, no errors | `button: false` was passed, or `Junco.init` never ran | Call `Junco.open()` from your own menu, or remove `button: false`. Check `window.Junco` exists in the console. | | Console: `Refused to load the script 'https://desk.juncodesk.app/widget/junco.js'` | Your Content Security Policy | Add `https://desk.juncodesk.app` to `script-src`. | | Console: `Refused to connect to 'https://desk.juncodesk.app/v1/…'` | Your Content Security Policy | Add `https://desk.juncodesk.app` to `connect-src`. | | `junco.js` answers 404 | Wrong server address | Use `https://desk.juncodesk.app/widget/junco.js` exactly. | | `Junco.init needs { game: 'jk_...' }` | `game` missing | Pass the product's public key. | | `Junco is not defined` | The call ran before the script loaded | Call `Junco.init` after the script tag, or in its `onload` (see [Installing the form](/docs/install)). | | Nothing in server-side rendering | The widget is browser only | Start it in `useEffect`, `onMounted`, `onMount` or a `.client` plugin. | | Options seem stuck at their first values | `init` runs once | Pass functions that read current state. | | Hidden behind something | Another element with a bigger `z-index` than 2147483000 | Lower it, or open the form from your own menu. | ## Messages from Junco | Message | Status | Cause | Fix | |---|---|---|---| | `This page isn't allowed to use this game's support` | 403 | The page's address (scheme, host and port) isn't one of the product's web addresses | Add it on the product's page in Junco, exactly: `https://example.com`, not `https://example.com/play`. `www.` counts as different. Development: `http://localhost:5173`. | | `Unknown game` | 404 | The public key is wrong, or the product was deleted | Copy the key from the product's page (`jk_...`). | | `Missing player` | 401 | No `X-Junco-Player` and no `Authorization` header | Send one (the widget does it for you). | | `anonymous id must be 32-128 url-safe characters` | 401 | The random id is too short or has other characters | 24 random bytes as URL-safe base64 (32 characters) or hex (48). | | `This game needs a player token` | 401 | **Without an account** is off for the product, and no token was sent | Send a signed token, or turn **Without an account** back on. | | `This game doesn't use player tokens` | 401 | A token was sent, but no signing key was made for the product | **How users are recognised → Make a key**, or stop sending a token. | | `Player token isn't valid` | 401 | Wrong key, `alg` not `EdDSA`, `aud` isn't this product's `jk_` key, `exp` passed or more than 7 days ahead, `sub` empty or over 200 characters | Check the claims ([Signed user tokens](/docs/user-tokens)). After **Make a key** again, old tokens stop working: use the new `.pem`. | | `No such ticket` | 404 | The number doesn't exist, or it's another user's | Use numbers from `GET /tickets` for this same user id or token. | | `text: Too small…` / `type: Invalid option…` | 400 | A field is missing or wrong | `type` is `bug`, `idea` or `help`; `text` isn't empty. | | `ticket: expected JSON` | 400 | Multipart without a `ticket` text field | Add the `ticket` field holding the JSON. | | `Unexpected field: …` | 400 | Multipart with a field other than `ticket`, `screenshot`, `save`, `log` | Rename or drop it. | | `Too many files` | 400 | More than 3 files | Send at most one each of screenshot, save and log. | | `Send JSON or multipart form data` | 415 | Wrong `Content-Type` | `application/json` or `multipart/form-data`. | | `The screenshot isn't a file type Junco accepts` | 415 | Not PNG, JPEG or WebP (checked from the bytes) | Encode as JPEG. | | `The log isn't a file type Junco accepts` | 415 | Not UTF-8 text, or has NUL bytes | Send text. | | `The screenshot is too big` (or save, log) | 413 | Over 2 MB, 1 MB or 512 KB | Scale the screenshot to 1280 px wide, JPEG at 70 to 80%. | | `Game context is too big` | 413 | `context` over 16 KB | Send less: the useful bits, not the whole state. | | `That's too big to send` | 413 | The request is over 4 MB | Smaller files. | | `Too many messages from you. Try again in N s.` | 429 | Over 20 messages in 10 minutes | Wait `Retry-After` seconds. | | `Too many messages from this connection…` / `…for this game…` / `Too many requests…` | 429 | Per-address or per-product limits | Wait; if a whole office or school shares one address, tell us. | | `There's no support page here.` | 404 | The hosted page is off for the product, or the key is wrong | Turn on **Junco's support page** on the product. | ## Releases | Message | Fix | |---|---| | `Send the game's release key: Authorization: Bearer jr_...` | Send the header; check the secret is set in your CI. | | `That release key isn't known (made a new one? use that)` | Making a new key replaces the old one. | | `{"released": 0}` | Nothing was waiting: tickets wait for a release only after their GitHub issue is closed as completed. | ## The AI | Symptom | Cause | Fix | |---|---|---| | No AI replies; tickets go straight to **Needs you** with "The AI was paused" | No credit, the AI is off for the studio or product, or the product reached its monthly cap | The **AI** page says which. Top up, switch it on, or raise the cap. | | Every reply is held | **Hold replies** is on, perhaps turned on by Junco itself after many failed checks | Read the held replies' reasons, fix the knowledge, then turn it off on the **AI** page. | | Replies say "I don't know" | The answer isn't in the knowledge | Add it ([Teaching the AI](/docs/knowledge)). | | A good reply was held for a link | The site isn't on **Sites replies may link to** | Add your help site's host under the Knowledge editor. | | Wrong area on tickets | Areas missing or vague in the knowledge | List them under `## Areas`. | ## Desk and sign-in | Symptom | Fix | |---|---| | "This invite has already been used", or the invite has expired or was taken back | Ask your studio's admin for a new one (7 days, one use). | | "That email already has a Junco login…" | One studio per person for now: use another email, or ask us. | | No passkey on a new device | Sign in on a device that has one, then **Settings → Passkeys → Add a passkey on this device**; or use a passkey that syncs. | | Lost every device | Ask your studio's admin, or us, for a one-time sign-in link. | | "…'s desk is paused. Contact Junco to turn it back on." | Contact us. Your users' tickets are still being taken. | | GitHub repo not in the list | Use **Add it on GitHub** to give Junco's app access to that repo. | | No phone alerts | Check the **Alerts** page: ntfy topic subscribed, quiet hours, and **Send a test alert**. | Still stuck? Use the form on Junco's website, or the support form on your desk. --- # How Junco handles your users' data > **In short.** Junco keeps what users send (messages, context, files) on its own UK servers, > apart from every other studio's. Personal details are replaced with placeholders before any AI > model sees a message, and models run with zero data retention. Files go after 90 days, finished > conversations after a year. Users can delete everything they've sent themselves. Your studio is > the controller; Junco is the processor. Your users' messages often hold personal details. This is what Junco does with them. ## What Junco keeps - What users send: their messages, the context your product attaches, and any screenshot, save or log file. - Who they are, as far as your product says: a random browser id, or your id for them from a signed token, and the display name you pass. - Users never make a Junco account and never give Junco a password. Only your studio's team can see your tickets. Each studio's data is kept apart by the database itself, so a mistake in one query can't show one studio another's tickets. ## The AI - **Before the AI sees a ticket**, Junco replaces personal details with placeholders: emails, phone numbers, postcodes, card numbers, IP addresses, real names, and things that look like passwords or keys. The model sees `[EMAIL_1]`, never the email. - Models are reached through OpenRouter with **prompt logging off** and routing only to providers that **don't keep or train on the data**. - **Every AI reply is checked** before a user sees it: rules in code and a second model. A reply that fails, mentions money, accounts, bans or another user, or makes a promise, waits for a person instead. - GitHub issues made from tickets never include personal details, and are checked again before they're made. ## How long it's kept - Screenshots, saves and logs: **90 days**, then the files are deleted. - Finished conversations (resolved or released): **a year** after the last message, with everything in them. - A user with nothing left who hasn't been back for a year is deleted too. ## Your users' rights - **Your users** see a plain privacy notice, linked as "Privacy" from the support form and the hosted page (`https://desk.juncodesk.app/privacy/`). Add your own privacy policy on the product's page and it's linked from there. - **They can delete everything they've sent**, themselves: "Delete everything I've sent" at the bottom of the support form. - **When someone asks you for a copy or to delete their data**, open one of their tickets: an admin can **Download their data** (everything Junco holds about them, as JSON, internal notes marked) or **Delete their data** (every ticket, message, file and AI note). ## Who's responsible For your users' data, your studio decides what it's used for (the controller) and Junco handles it for you (the processor). The details are in the [data processing agreement](/legal/dpa) and [Junco's privacy policy](/legal/privacy). --- # Security > **In short.** Each studio's data is kept apart by the database itself (row-level security), not > just by application code. Your team signs in with passkeys only; users never have a Junco > account. Signed user tokens use Ed25519 and Junco holds only the public key. Uploads are checked > by their bytes and never served as web pages. Personal details are removed before any AI model > sees a message. Junco runs on its own servers in the United Kingdom. ## Keeping studios apart - Every row of studio data (products, tickets, users, messages, files, AI runs) belongs to a studio, and **PostgreSQL row-level security** enforces it: Junco's server connects as a role that can only see the rows of the studio it's acting for. A bug in one query can't show one studio another's tickets; the database refuses. - Tests check that queries can't cross studios, and that one studio can't reach another's products, invites, GitHub installations or repos. ## Signing in - **Your team: passkeys only** (WebAuthn). No passwords to leak, reuse or phish; a passkey only works on Junco's own address. - **Joining** is by invite link: single use, 7 days, and only a hash of the link is stored. - **Sessions** are per device and can be signed out from **Settings**. Removing someone from a studio signs them out everywhere. - **Roles**: Admins manage products, GitHub and the team; Members work the inbox. ## Your users - Users never make a Junco account or give Junco a password. - **Signed tokens** ([Signed user tokens](/docs/user-tokens)) are Ed25519 JWTs your server signs. The private key is made in your browser and downloaded; Junco only ever stores the public key. Tokens are bound to one product (`aud`) and last at most 7 days. - **Random ids** for users without accounts are long and random (at least 32 characters), so they can't be guessed. A user only ever sees their own tickets; another ticket's number answers 404. - Browser calls are only accepted from the product's listed web addresses (CORS), and rate limits apply per user, per network address and per product. ## Files - Screenshots are accepted only if their bytes are really PNG, JPEG or WebP; logs only if they're UTF-8 text. Saves are kept as opaque downloads. - Files are served to your team only, signed in, as images or downloads, never rendered as HTML. - Size limits on every file and request. - Files are deleted after 90 days. ## The desk, widget and website - A strict **Content Security Policy** on the desk, the hosted page, the guides and the website: only Junco's own scripts, nothing loaded from anywhere else, no trackers, no adverts. - The widget runs in a **closed shadow root**, adds no cookies (`credentials: "omit"`), and loads nothing but itself and Junco's API. - All traffic is encrypted: HTTPS to Cloudflare, then an encrypted tunnel to Junco's servers. No ports are open to the internet. ## The AI - **Personal details are removed** before a model sees a ticket ([How the AI works](/docs/ai)). - Models are reached through OpenRouter with **prompt logging off** and **zero data retention**: only providers that don't keep or train on the data. - Every reply passes rule checks and a second model's checklist, including "doesn't follow instructions hidden in the user's message" (prompt injection), or it's held for a person. - GitHub issues drafted by the AI are checked for personal details before they're created. - Each studio's AI usage runs on its own OpenRouter key, limited to that studio's credit; the keys are stored encrypted. ## GitHub - Junco's GitHub App asks only for **issues** (read and write) and basic repo details, on the repos you choose. - Connecting needs both the installation and **your GitHub sign-in**, so a studio can only link repos its own people can reach (an installation id alone, which can be forged, isn't trusted). - Webhooks from GitHub are verified by signature. ## Operations - Hosted on Junco's own servers in the United Kingdom, run by Big Beans Studio. - Encrypted nightly backups, kept up to 12 months; restores are tested. - Secrets (API keys, signing keys) are kept out of the code and readable only by the service. - Sub-processors and what each sees: [Sub-processors](/legal/subprocessors). ## Reporting a security problem Please tell us privately through the form on Junco's website, saying it's about security. We'll reply quickly and credit you if you'd like.