@asiyst/sdk

中文文档
0.1.31发布于 2026/11/05MITTypeScriptESM + CJS近 30 天下载 1875

Client-side runtime that connects a website to Asiyst Cloud

原始使用文档
文档目录3 节
  1. Install
  2. Usage
  3. Documentation

@asiyst/sdk

Client-side runtime that connects a website to Asiyst Cloud.

This package does not contain model keys, database credentials, or other server secrets. Identify the project with projectId and publicKey only. Those values are public project credentials, not secrets.

Install

npm install @asiyst/sdk

Then connect the project:

npx @asiyst/cli init

asiyst init opens https://asiyst.com so you can create a project and copy credentials. Avatar appearance and behavior live in Asiyst Cloud so you can change them without redeploying the site.

Usage

Project ID is required. The value must be the public Project ID for the target Asiyst project, not the developer account user ID and not the internal Supabase UUID.

import { Asiyst } from "@asiyst/sdk";

await Asiyst.init({
  projectId: "<PUBLIC_PROJECT_ID>",
  publicKey: "<PUBLIC_KEY>",
  avatarId: "<PUBLIC_AVATAR_ID>",
});
Asiyst.open();

Do not pass a secret API key as publicKey or omit projectId.

avatarId is a public identifier, not an authorization credential. The server remains authoritative for project and installation authorization.

Knowledge sources, including optional GitHub repositories, are configured in Asiyst Web. The SDK does not receive GitHub credentials and does not copy Knowledge Base content into the website. It initializes the verified project/avatar and retrieves authorized knowledge through the Asiyst backend.

await Asiyst.init({
  publicKey: "<PUBLIC_KEY>",
});
// throws: Asiyst SDK: projectId is required.

Mark important controls so the assistant can find them across layouts:

<button data-asiyst="pricing">Pricing</button>
<button
  data-asiyst="checkout"
  data-asiyst-description="Proceed to checkout"
>
  Checkout
</button>

The production API base is https://nqhxpgsjofzqudyqkqib.supabase.co/functions/v1/api. It is used by default and can only be overridden explicitly through apiBaseUrl for a controlled non-production deployment.

If runtime config is unavailable, the SDK retains its local or eligible cached fallback config. getConnectionStatus() reports runtime verification separately. Visitor chat requires a verified installation and runtime token. Cloud task planning, workflows, telemetry, and website-map upload are not part of the current approved contract and are not sent.

Documentation

  • Architecture: docs/ARCHITECTURE.md
  • API and events: docs/API.md
  • Security: docs/SECURITY.md
  • Runtime contract: docs/sdk-cli-contract.md
  • Runtime details: docs/sdk-runtime.md
  • Installation: docs/sdk-installation.md
  • Troubleshooting: docs/TROUBLESHOOTING.md

版本与发布记录

@asiyst/sdk 共发布 24 个版本,首次发布于 2026/08/28;过去 12 个月发布了 24 个版本。

版本发布日期距今
0.1.31latest2026/11/053 天前
0.1.302026/10/317 天前
0.1.292026/10/2514 天前
0.1.282026/10/2019 天前
0.1.272026/10/2019 天前
0.1.252026/10/1920 天前

关于 @asiyst/sdk 的常见问题

@asiyst/sdk 是什么?

Client-side runtime that connects a website to Asiyst Cloud

如何安装 @asiyst/sdk?

在项目目录运行 npm install @asiyst/sdk,或使用 pnpm add / yarn add / bun add。

@asiyst/sdk 支持 TypeScript 吗?

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

@asiyst/sdk 支持 ESM 还是 CommonJS?

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

@asiyst/sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.18.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@asiyst/sdk 可以商用吗?

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

@asiyst/sdk 的下载量有多少?

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

@asiyst/sdk 还在维护吗?

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