npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lark-apaas/aily-web-sdk

v0.0.11

Published

Aily Web SDK - iframe-based chat panel integration

Readme

Aily-Web-SDK

Aily Web SDK 是飞书 Aily 团队推出的轻量级 SDK,通过 iframe + postMessage 方式让你快速接入 Aily AI 能力。

特点

  • 轻量级: 纯 iframe 实现,无 CDN 资源加载
  • 高隔离性: 完全隔离的运行环境
  • 简单易用: 简洁的 API 设计

安装

npm install @lark-apaas/aily-web-sdk

使用

@lark-apaas/aily-web-sdk 当前提供两个初始化 API,分别面向不同的 Aily Chat 场景:

  • initAilyChat:用于初始化 Aily 工作流应用 Chat 面板,适合接入已有工作流应用的对话能力。
  • initAgentChat:用于初始化 Aily 新版智能体 Chat 面板,适合接入新版智能体会话页面。
import { initAilyChat } from '@lark-apaas/aily-web-sdk'

const container = document.querySelector('.container');
const chatPanel = await initAilyChat(container, {
  appKey: 'your-app-key',
  common: {},
  events: {
    onReady: () => console.log('ready'),
    onError: (error) => console.error(error)
  }
});
import { initAgentChat } from '@lark-apaas/aily-web-sdk'

const container = document.querySelector('.container');

const sdk = await initAgentChat(container, {
  channelToken: 'wsk_xxx',
});

API

initAilyChat(root, config)

初始化 Aily 工作流应用 Chat 面板。

适用场景:

  • 宿主页面需要接入 Aily 工作流应用的 Chat 能力
  • 需要使用 ChatPanel 提供的消息发送、清空、更新配置等控制方法

参数:

  • root (HTMLElement) - iframe 挂载的容器元素
  • config (WebSDKConfig) - 配置项
    • appKey (string) - 应用 Key
    • uuid (string, 可选) - 用户标识
    • device ('pc' | 'mobile', 可选) - 设备类型
    • common (WebSDKCommonConfig) - 通用配置
      • baseURL (string) - Aily 服务地址
      • headers (Record<string, string>, 可选) - 自定义请求头
    • events (WebSDKEvents, 可选) - 事件回调
      • onReady - iframe 就绪回调
      • onError - 错误回调
      • onMessage - 消息回调

返回: Promise<ChatPanel>

initAgentChat(root, config)

初始化 Aily 新版智能体 Chat 面板。

适用场景:

  • 宿主页面需要嵌入 Aily 新版智能体的 Chat 页面
  • 只需要完成智能体 Chat 面板的初始化与销毁管理

参数:

  • root (HTMLElement) - iframe 挂载的容器元素
  • config (AgentSDKInitConfig) - 配置项
    • channelToken (string) - agent 渠道 token

返回: Promise<AgentSDKInstance>

ChatPanel

| 方法 | 说明 | | --- | --- | | sendMessage(data) | 发送消息 | | clear() | 清空聊天记录 | | cancelMessage(messageItem) | 取消消息 | | clearAndStop() | 清空消息并停止当前响应 | | updateWelcomeMessage() | 刷新欢迎消息 | | updateConfig(config) | 更新面板配置 | | destroy() | 销毁实例 |

AgentSDKInstance

| 方法 | 说明 | | --- | --- | | destroy() | 销毁 agent iframe 实例 |

License

MIT