@akropolys/kiku

中文文档
2.2.44发布于 2026/11/02MITTypeScriptESM + CJS零依赖近 30 天下载 5138

The real-time conversational layer for the living web.

原始使用文档
文档目录9 节
  1. JavaScript embed
  2. Install
  3. React and Next.js
  4. What visitors can do
  5. Components
  6. Customize the launcher
  7. Your content and actions
  8. Links
  9. License

@akropolys/kiku

Chat, search, voice, and photo input for your website. Kiku connects visitors to your content and the API actions you configure in Akropolys. For React and Next.js, use the React package below. For other websites, use the CDN embed; it also works in React when you prefer a script integration.

npm License: MIT TypeScript

JavaScript embed

Add Kiku to any website with the published CDN script:

<script
  src="https://cdn.akropolys.cloud/kiku/2.2.44/kiku.js"
  data-site-id="YOUR_SITE_ID"
  data-api-token="YOUR_PUBLIC_BROWSER_TOKEN"
  data-label="Ask Kiku"
  data-vision="true"
  defer
></script>

The embed includes its own React runtime, styles, and mounting. Your website needs no React installation or provider, including when it uses React or Next.js. See the embed guide for configuration, ingestion, and self-hosting.

Install

Recommended for React and Next.js apps:

npm install @akropolys/[email protected] @akropolys/[email protected]

This package integration requires React and React DOM 17 or later.

React and Next.js

'use client';

import { AkropolysProvider } from '@akropolys/sdk';
import { KikuButton } from '@akropolys/kiku';
import '@akropolys/kiku/styles.css';

export default function WebsiteAssistant() {
  return (
    <AkropolysProvider
      siteId={process.env.NEXT_PUBLIC_AKROPOLYS_SITE_ID!}
      apiUrl={process.env.NEXT_PUBLIC_AKROPOLYS_API_URL!}
      apiToken={process.env.NEXT_PUBLIC_AKROPOLYS_API_TOKEN!}
    >
      <KikuButton label="Ask us" enableVoice enableVision />
    </AkropolysProvider>
  );
}

Mount the component once in your app or layout. In Next.js App Router, import the stylesheet in your root layout if that is where your project keeps global CSS.

Use your site's public browser token. Keep private keys and server credentials on your server. Enable the corresponding voice and vision features for your site in Shell.

What visitors can do

  • Ask about your content and compare records in tables.
  • Talk using live voice or include photos in a conversation.
  • Open source records and save items for later.
  • Long-press or right-click a message to access its actions.
  • Use translated controls, right-to-left layouts, and chat themes.

Components

ComponentPurpose
KikuButtonA launcher that opens the chat window.
SearchBarInline search with streamed results.

Both components use AkropolysProvider from @akropolys/sdk.

Customize the launcher

<KikuButton
  label="Ask about this property"
  title="Your assistant"
  placeholder="What would you like to know?"
  chips={['Show available properties', 'Compare my options']}
  theme="dark"
  enableVoice
  enableVision
/>

theme accepts light, dark, or an AkropolysTheme object from @akropolys/sdk. Use onSelectSource to handle a visitor selecting a source record.

Your content and actions

Give each catalogue record a stable top-level id. A webpage link in fields.url is optional; Kiku can show and save records without one. See the SDK ingestion guide.

Configure action endpoints, methods and request fields in Shell. The widget calls your API from the visitor's browser in chat and voice. Cookie authentication works automatically. For Clerk, Auth0 or Supabase bearer APIs, add one option such as actionAuth: { provider: "supabase", client: supabase } to Kiku.mount(...), or use the actionAuth prop on your existing React provider. The existing auth client handles token renewal; Kiku adds the header internally. The CDN embed needs no application wrapper. Your API validates permissions and performs the operation. See the site actions guide.

License

MIT © Akropolys

版本与发布记录

@akropolys/kiku 共发布 101 个版本,首次发布于 2026/06/04;过去 12 个月发布了 101 个版本。

版本发布日期距今
2.2.44latest2026/11/023 天前
2.2.432026/10/306 天前
2.2.422026/10/307 天前
2.2.372026/10/297 天前
2.2.342026/10/298 天前
2.2.332026/10/2710 天前

关于 @akropolys/kiku 的常见问题

@akropolys/kiku 是什么?

The real-time conversational layer for the living web.

如何安装 @akropolys/kiku?

在项目目录运行 npm install @akropolys/kiku,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=17)、react-dom(>=17)、@akropolys/sdk(^2.0.8)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@akropolys/kiku 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@akropolys/kiku 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@akropolys/kiku 可以商用吗?

@akropolys/kiku 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@akropolys/kiku 的下载量有多少?

根据 npm 官方下载统计,@akropolys/kiku 在 2026/10/06 – 2026/11/04 这 30 天内被下载 5,138 次,日均约 171 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@akropolys/kiku 还在维护吗?

最新版本 2.2.44 发布于 2026/11/02(3 天前);至今共发布 101 个版本,其中过去 12 个月发布了 101 个;首次发布于 2026/06/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。