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

@alicloud/appflow-chat

v0.0.1-beta.3

Published

Appflow-Chat AI聊天机器人组件库,提供聊天服务和UI组件

Readme

Appflow Chat SDK

AI chatbot component library providing chat services and UI components.

中文文档

Installation

Basic Installation

npm install @alicloud/appflow-chat

Install Peer Dependencies

This SDK requires the following peer dependencies. Please ensure they are installed in your project:

npm install react react-dom antd

| Dependency | Description | |-----|------| | react | React core library | | react-dom | React DOM rendering | | antd | Ant Design UI component library |

Quick Start

1. Initialize Service

import { chatService } from '@alicloud/appflow-chat';

// Initialize
const config = await chatService.setup({
  integrateId: 'your-integrate-id',
  domain: 'https://your-domain.com',
  access_session_token: 'optional-token'
});

console.log('Welcome message:', config.welcome);
console.log('Suggested questions:', config.questions);

2. Send Messages

// Send text message
chatService.chat({ text: 'Hello' })
  .onMessage((content, done, meta) => {
    console.log('AI response:', content);
    if (done) {
      console.log('Response complete');
    }
  })
  .onError((error) => {
    console.error('Error:', error);
  });

3. Use UI Components

import { MessageBubble, RichMessageBubble } from '@alicloud/appflow-chat';

// Simple message bubble
<MessageBubble 
  content="This is AI response, supports **Markdown** format"
  role="bot"
  status="Success"
/>

// Rich text message bubble (supports charts, tables, etc.)
<RichMessageBubble 
  content={richContent}
  messageType="rich"
  status="Success"
/>

4. Use MarkdownView Component

import { MarkdownView } from '@alicloud/appflow-chat';

// Render Markdown content
<MarkdownView 
  content="# Title\n\nThis is **Markdown** content, supports:\n- Code highlighting\n- Math formulas\n- Chart rendering"
  waitingMessage="Thinking..."
/>

5. Use Core Components (Advanced Customization)

import { BubbleContent, SourceContent } from '@alicloud/appflow-chat';

// Custom message bubble
<div className="my-bubble">
  <BubbleContent content={content} status={status}>
    {/* Custom reference component */}
    <SourceContent items={references} />
  </BubbleContent>
</div>

API Documentation

ChatService

| Method | Description | |-----|------| | setup(config) | Initialize SDK | | chat(message) | Send message | | upload(file) | Upload file | | cancel() | Cancel current request | | clear() | Clear session | | getHistory(sessionId?) | Get chat history | | getSessions() | Get session list | | sendEventCallback(data) | Send event callback (for humanVerify, cardCallBack, etc.) | | submitHumanVerify(data) | Submit human verification result (convenience wrapper for sendEventCallback) |

UI Components

| Component | Description | |-----|------| | MarkdownRenderer | Markdown rendering component (with interactions) | | MessageBubble | Message bubble component | | RichMessageBubble | Rich text message bubble component | | DocReferences | Document references component | | WebSearchPanel | Web search results panel | | HumanVerify | Human verification form component | | HistoryCard | History card component for approval records | | CustomParamsRenderer | Custom parameters renderer component |

Markdown Components

| Component | Description | |-----|------| | MarkdownView | Core Markdown rendering component, supports code highlighting, math formulas, charts, etc. |

Core Components

| Component | Description | |-----|------| | BubbleContent | Core bubble content component | | RichBubbleContent | Core rich text bubble content component | | SourceContent | Core reference content component | | WebSearchContent | Core web search content component |

Project Structure

src/
├── index.ts                 # Entry file
├── services/
│   └── ChatService.ts       # Chat service
├── components/              # SDK components (simplified interface)
│   ├── MarkdownRenderer.tsx
│   ├── MessageBubble.tsx
│   ├── RichMessageBubble.tsx
│   ├── DocReferences.tsx
│   ├── WebSearchPanel.tsx
│   └── HumanVerify/         # Human verification components
│       ├── HumanVerify.tsx
│       ├── HistoryCard.tsx
│       └── CustomParamsRenderer/
├── core/                    # Core components (pure display)
│   ├── BubbleContent.tsx
│   ├── RichBubbleContent.tsx
│   ├── SourceContent.tsx
│   └── WebSearchContent.tsx
├── markdown/                # Markdown rendering
│   ├── index.tsx            # MarkdownView component
│   └── ...
├── hooks/
│   └── usePreSignUpload.ts
└── utils/
    └── loadEcharts.ts

License

MIT