Skip to content
boldarePublic

About

Dare to ask. An AI chat for any website, served by your Next.js app on the official OpenAI SDK: one route, one script tag, no database.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

954 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

askdare: an AI assistant for any website, in one script tag. A chat panel answers a question about a pricing plan with a list, a table and two cited sources.

An AI chatbot for any website, served by your Next.js app on the official OpenAI SDK.
One route, one script tag, no database required.

Live demo · Deploy in 5 minutes · Documentation · npm · Changelog

CI npm License: MIT

Your chatbot in five minutes

One-click deploy to Vercel. Bring an OpenAI key, we'll do the rest.

No Next.js app yet? Deploy the starter: your own repository, your OpenAI key, no database and no code to write. askdare.vercel.app/deploy walks you through it and makes the CHAT_SECRET for you. Heroku and the details.

Deploy with Vercel

The one-click deploy in 19 seconds: from askdare.vercel.app to the /deploy page, where the CHAT_SECRET is made, then Vercel deploys the starter, and the new app's chat answers a question.

Three steps

How it works: install the package, run init, and paste one script tag on any website. The chat opens on the site from a launcher in the corner.

In a Next.js 16 app:

npm install @boldare/askdare zod
npx @boldare/askdare init

init writes the chat route, a bot to start from and .env.local, and adds the chat to your layout. Put your OpenAI key and model in .env.local, run the app, and the chat is there. The bot is a few lines you own:

// askdare.config.ts
import { defineBot } from '@boldare/askdare';

export const bots = [
  defineBot({
    id: 'support',
    model: process.env.ASKDARE_MODEL ?? '',
    instructions: 'You answer questions about our product. If you do not know, say so.',
    security: { allowedOrigins: ['https://www.example.com'] },
    widget: { theme: 'aura', greeting: 'Hi! How can I help?' },
  }),
];

Getting started takes you from an empty app to a working chat in about 15 minutes.

Or try it first, in five minutes, without your own app.

What you get

What it does: answers from your documents with citations, your own tools, images and PDFs, voice input, secure by default, the chat inside your own page with React, thumbs-up and thumbs-down ratings of answers, observability with OpenTelemetry, and chat events for analytics. Also clickable answers suggested by the model, reply options from your tools, switching the chat's language from the page, a one-click deploy, tool cards drawn by your own React components, your own page inside the widget, and texts per language. New in 0.5: guardrails with OpenAI moderation and your own rules, a human check with Cloudflare Turnstile, seven built-in languages, and WCAG 2.2 AA. No database.

Knowledge base · Tools · Tool cards · Reply options · Attachments · Voice input · The chat inside your page (React) · Your own page in the widget · Answer ratings · Handoff to a person · Forms and leads · Admin console and dashboard · Launcher greeting · Observability · Chat events · Guardrails · Human check · Accessibility · Own your data · Security

New in 0.7, support-grade:

  • Handoff to a person: a "Talk to a person" button and a handoff tool the model calls when it can't help, with webhookHandoff() (signed with Standard Webhooks) or emailHandoff() delivering the request. It is one-way: a person from your team answers the visitor by email. Outside your office hours, the handoff's form takes a message instead. See Handoff.

  • Forms in the chat: defineForm with text, email, phone, select, textarea and consent fields, validated on the server and drawn by the widget with no code on your site. Each sent form goes to your onLead, and its values reach the model only for the fields you mark. See Forms.

  • Admin console and dashboard: a console at /api/chat/admin, off by default, with each bot's configuration, doctor, a playground and conversation reviews, signed in with ADMIN_SECRET or an identity token. Records live in an admin store (memory, Postgres or Upstash), and the new @boldare/askdare-admin adds a dashboard: cost per bot, day and model, ratings, unanswered questions, leads and handoffs. Deleting a conversation deletes its records. See Admin.

    The admin console in 31 seconds, for the site's owner rather than visitors: signing in, a bot's configuration, doctor checking every bot, a question in the playground, a conversation with a lead form and a handoff, and the dashboard.

  • A greeting next to the launcher and an unread badge: widget.launcherGreeting invites visitors after a few seconds, and answers that arrive while the chat is closed are counted on the launcher. See Embedding.

New in 0.6, own your data:

  • Conversations in your own Postgres: postgresConversations() from the new @boldare/askdare-postgres, with migrate for the tables and a sweep for your retention. Turns go to OpenAI with store: false: it still processes every request, but keeps no conversation. See Own your data.
  • Knowledge in pgvector: pgvectorIndex with askdare kb sync --index, searched by the built-in search_knowledge tool, with the same cited sources and no per-search fee. See Knowledge base.
  • Answers that survive a dropped connection: the chat picks an answer up where it stopped, from memory on one server or from Upstash on several (upstashTurnLog()). See Configuration.
  • The whole history: older messages load in pages as the visitor scrolls up (LoadEarlier). See React.
  • Compaction and transcripts: opt-in limits.compactAt keeps long conversations in your store affordable, and onTranscript hands each finished turn to your code. See Configuration.
  • Still at OpenAI: OpenAI processes every model request, and attachments stay in OpenAI Files. See What stays at OpenAI and the changelog.

Themes

Four themes, light and dark, or your own: the welcome screens of Halo, Aura in dark mode, Sage, Care, and BLDR, a custom theme in Boldare's style.

Pick a theme, set your brand's colors, or restyle any part with your own CSS, the way BLDR does. Switch between them on the website, then read Themes and Styling.

Documentation

The guides are on askdare.vercel.app/docs, with search and a chat that answers from them. The same pages are in docs/, and they ship in the package, so they match the version you installed.

Coming from @boldare/openai-assistant? It stopped working when OpenAI shut down the Assistants API, and askdare is its successor: see Migrating.

Packages

Package What it is
@boldare/askdare The library: bots, the chat route, the embeddable chat and the CLI
@boldare/askdare-upstash Rate limits, budgets and answer resume shared by every server instance, and an admin store, in Upstash Redis
@boldare/askdare-otel OpenTelemetry spans for every chat turn, following the GenAI conventions
@boldare/askdare-postgres Conversations, a pgvector knowledge index and an admin store in your own Postgres
@boldare/askdare-admin The admin dashboard: cost, ratings, unanswered questions, leads, handoffs and conversation reviews, inside the admin console

Contributing · Security policy · MIT license · Made by Boldare

About

Dare to ask. An AI chat for any website, served by your Next.js app on the official OpenAI SDK: one route, one script tag, no database.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages