Skip to content
DaneshyarDocs
Sign in
  • Introduction
  • Quickstart
  • What is Daneshyar?
  • The Apps page
  • Inside an app
  • Workspace: files and chat
  • Sharing and members
  • Notes and dictation
  • Language practice
  • Appointment booking
  • Automations
  • The file reader
  • Your profile
  • Wallet
  • Customer chats
  • API keys
  • Authentication
  • Apps, workspaces, resources
  • Ingestion
  • Chat and sessions
  • Citations
  • Skills
  • Conventions
  • Workspaces
  • Resources
  • Chat
  • Skills
  • Errors
  • Customer support assistant
  • Internal knowledge base
  • Documentation chatbot
  • Academy tutor
  • Embedded widget
  • Widget configuration
  • Framework guides
  • Security
  • Troubleshooting
  • FAQ
  1. Docs
  2. Security and help
  3. Troubleshooting

Troubleshooting

Find your problem by what you see, then read why it happens and how to fix it.

Check these first

Most problems show up in one of these three places:

  1. 1

    Open the browser console

    Press F12 (or Cmd+Option+I on a Mac) and choose Console. The widget's own messages start with [Daneshyar].

  2. 2

    Look at the Network tab

    Filter by widget. Check that widget.js loads, and look at the status code of each /api/widget/ request.

  3. 3

    Compare with the Embed page

    Copy the snippet again from the console and compare it with your site, letter by letter. A missing quote or a changed id is the most common cause.

Widget problems

Why: The console says [Daneshyar] widget.js needs data-api-key, data-app-id and data-workspace-id, or widget.js did not load at all.

Fix: Check that all three attributes are on the same script tag and are not empty. An environment variable that was not set at build time is empty. Check the src address in the Network tab.

Why: Inline mode needs an element to fill, and the script ran before that element existed, or the selector is wrong.

Fix: Add <div id="daneshyar-widget"></div> above the script tag, or set data-target to your own selector.

Why: The chat opened, but it got no widget key.

Fix: Check that data-api-key has a value. In a framework, check that the environment variable is available in the browser (for example the NEXT_PUBLIC_ or VITE_ prefix).

Why: Your site is not in the app's allowed domains — and all sites are blocked by default, so an empty list blocks yours too. The list belongs to the whole app, so it covers every workspace you embed. Remember that *.clinic.ir does not match clinic.ir, and that localhost:5173 does not match localhost:3000.

Fix: In the console, open the Embed page and add the exact host you see in the address bar.

Why: The widget is turned off for this workspace. Each workspace has its own switch, and a new workspace starts off.

Fix: docs.troubleshooting.widgetItems.widgetOff.fix

Why: Your own site sends a Content-Security-Policy that does not allow the widget's site.

Fix: Add the widget's site (the address in the snippet's src) to script-src and frame-src in your policy.

Why: The widget could not load its settings. Usually the widget key is wrong or was regenerated (403), or the workspace id does not belong to this app (404). A secret key (sk_…) in the snippet also gives 403.

Fix: Copy the snippet again from the Embed page of the right workspace. If the ids are right, try again in a minute: it may be a network problem.

Why: A rate limit was reached: 20 questions an hour from one IP address, or 500 a day for the whole app.

Fix: Wait and try again. Many people behind one office network share one IP address. If you need higher limits, contact us.

Why: The wallet of the account that owns the app is empty (402). Visitors never see a billing message.

Fix: Top up the owner's wallet in the console (avatar menu → Wallet).

Why: The workspace has no documents, or none of them is ready yet.

Fix: Upload documents in the console and wait until their status is Ready.

Why: This is by design. The widget answers only from the workspace's documents and politely declines everything else.

Fix: Ask about something your documents cover, or add a document that answers it.

Why: In a single-page app, the script was added inside a page component, or in two places.

Fix: Load it once, in the root layout or root component. See Framework guides.

Why: The console cannot save an empty list yet.

Fix: To turn the widget off on every site, delete the widget key on the app page. Otherwise keep at least one domain in the list.

REST API problems

Every error has a status code and a body. The full list is on the Errors page.

Why: The X-API-Key header is missing, or the key is not a valid secret key. A widget key (pk_…) is refused here. A missing or wrong key returns 403, not 401.

Fix: Send the header on every request, with no spaces or line breaks around the key. Use the secret key (sk_…), not the widget key. Check that your server reads the right environment variable.

Why: The workspace id is wrong, the workspace was deleted, or it belongs to a different app. A key only sees its own app's workspaces, and it gets 404 for any other.

Fix: List your workspaces with GET /v1/workspaces/, using the same key, and use an id from that list.

Why: The request body is not valid, for example external_user_id is missing in a chat request.

Fix: Read the message field in the response: it names the field and the problem.

Why: The wallet of the account that owns the app is empty.

Fix: Top up the wallet in the console, then send the request again.

Why: Your website's JavaScript is calling /v1 directly. The API does not allow that, and it would expose your secret key.

Fix: Call the API from your server instead. See Security.

Why: A short problem on our side or on the network. An answer can take several seconds, because it reads your documents first.

Fix: Use a timeout of at least 60 seconds for chat requests. Retry 5xx errors after a short wait, and do not retry 4xx errors.

Browsers and devices

  • The widget works in all current versions of Chrome, Edge, Firefox and Safari, on desktop and phone.
  • The loader script is written in very old JavaScript on purpose, so it cannot break your page even in an old browser.
  • Some privacy extensions block third-party iframes. If the button shows but the chat stays empty, try once with extensions turned off.
  • A conversation lasts as long as the page is open. If the visitor reloads the page, a new conversation starts. Nothing is saved in the visitor's browser.
PreviousSecurityNextFAQ

On this page

  • Check these first
  • Widget problems
  • REST API problems
  • Browsers and devices

Every example on this site runs against the live API. If one doesn't, tell us — that's a bug in the docs.

ServicesAboutTalk to us