@dori-ai/dori-side-widget

中文文档
1.13.185发布于 2026/11/11ES Module零依赖近 30 天下载 2.5万

A modern, responsive chat widget built with React and Chakra UI, designed for seamless integration into any website. The widget provides an AI-powered chat experience with e-commerce capabilities, perfect for customer support and sales assistance.

原始使用文档
文档目录21 节
  1. 🚀 Features
  2. 📦 Installation
  3. Quick Start
  4. 🎨 Customization
  5. Styling
  6. 🔧 Development
  7. Local Development
  8. Building for Production
  9. Scoped NPM Publish ( @dori-ai/dori-side-widget )
  10. Development vs Production
  11. 📱 Widget Components
  12. Core Features
  13. Technical Architecture
  14. 🌐 Browser Support
  15. 📊 Analytics & Tracking
  16. 🔒 Security & Privacy
  17. 🚀 Performance
  18. 📞 Support
  19. 📄 License
  20. 🤝 Contributing
  21. 🔄 Updates

Dori Chat Widget

A modern, responsive chat widget built with React and Chakra UI, designed for seamless integration into any website. The widget provides an AI-powered chat experience with e-commerce capabilities, perfect for customer support and sales assistance.

🚀 Features

  • AI-Powered Chat: Intelligent conversation capabilities with natural language processing
  • E-commerce Integration: Product recommendations, shopping cart, and checkout flows
  • Responsive Design: Mobile-first approach that works on all devices
  • Persian/Farsi Support: Full RTL support with Persian UI elements
  • Customizable: Easy to customize colors, branding, and behavior
  • Shadow DOM: Isolated styling that won't conflict with your website
  • TypeScript: Built with TypeScript for better development experience

📦 Installation

Quick Start

Add this HTML structure to your page:

<div id="dori-react-widget-host"></div>
<script
  id="dori-react-widget"
  data-sharing-id="your-sharing-id"
  src="https://cdn.jsdelivr.net/npm/dori-chat-widget@latest/dist/widget.js"
></script>

🎨 Customization

Styling

The widget automatically adapts to your website's design while maintaining its own identity. You can customize:

  • Colors: Primary and accent colors
  • Branding: Logo and company information
  • Messages: Welcome text and default responses
  • Behavior: Chat flow and interaction patterns

🔧 Development

Local Development

  1. Clone the repository:
git clone <repository-url>
cd my-app
  1. Install dependencies:
npm install
  1. Start development server:
npm run dev
  1. Open your browser to http://localhost:3000

Building for Production

npm run build

This will create a dist folder with the production-ready widget files.

Scoped NPM Publish (@dori-ai/dori-side-widget)

Use these scripts to publish the scoped package with branch-safe tags:

# From dev branch -> publishes tag "dev" with auto dev timestamp version
npm run publish:dev:scoped

# From main branch -> publishes tag "latest" with package.json version
npm run publish:prod:scoped

Dry-run checks:

npm run publish:dev:dry
npm run publish:prod:dry

From CI (npm trusted publishing)

.github/workflows/publish.yml runs the same script on a clean runner and authenticates with a per-run OIDC token instead of an npm token, so nothing secret lives on a laptop:

gh workflow run publish.yml -f channel=dev  --ref dev  -R DoriService/dori-side-widget
gh workflow run publish.yml -f channel=prod --ref main -R DoriService/dori-side-widget

The prod run aligns package.json with the highest version on the registry, bumps the patch, publishes @latest and commits the bump back to main. Pull before a local prod publish afterwards or the next bump collides. The trusted-publisher entry on npmjs.com is keyed on the workflow filename; renaming publish.yml breaks CI publishing until it is updated.

CI releases carry no npm provenance: npm only accepts a provenance bundle from a public source repository, and this repo is private.

Development vs Production

  • Development: npm run dev - Uses direct DOM rendering for easier debugging
  • Production: npm run build - Creates optimized bundle with shadow DOM isolation

📱 Widget Components

Core Features

  • Welcome Screen: Initial greeting with animated logo
  • Chat Interface: Full-featured chat with message history
  • Product Recommendations: AI-powered product suggestions
  • Shopping Cart: Integrated e-commerce functionality
  • Responsive Design: Works seamlessly on all devices

Technical Architecture

  • React 19: Latest React with modern hooks and features
  • Chakra UI: Consistent, accessible component library
  • TypeScript: Full type safety and better development experience
  • Shadow DOM: Isolated styling and DOM structure
  • Vite: Fast build tooling and development server

🌐 Browser Support

  • Chrome 88+
  • Firefox 85+
  • Safari 14+
  • Edge 88+

📊 Analytics & Tracking

The widget automatically tracks:

  • Conversation sessions
  • User interactions
  • Product recommendations
  • Conversion metrics

All data is associated with your data-sharing-id for easy analysis.

🔒 Security & Privacy

  • Isolated Environment: Widget runs in shadow DOM for security
  • No Cross-Site Scripting: Secure communication protocols
  • Data Privacy: User data is handled according to privacy standards
  • GDPR Compliant: Built with privacy regulations in mind

🚀 Performance

  • Lightweight: Optimized bundle size for fast loading
  • Lazy Loading: Components load only when needed
  • Efficient Rendering: React 19 optimizations for smooth performance
  • CDN Delivery: Fast global distribution via jsDelivr

📞 Support

For technical support or questions:

  • Open an issue in the repository
  • Contact support at [email protected]
  • Check the documentation for common solutions

📄 License

This project is licensed under the MIT License.

🤝 Contributing

We welcome contributions! Please feel free to:

  • Submit bug reports
  • Request new features
  • Contribute code improvements
  • Improve documentation

🔄 Updates

The widget automatically updates when you use the @latest tag. For version-specific deployments, use:

<div id="dori-react-widget-host"></div>
<script
  id="dori-react-widget"
  data-sharing-id="your-id"
  src="https://cdn.jsdelivr.net/npm/[email protected]/dist/widget.js"
></script>

Dori Chat Widget - Making customer support smarter and more engaging.

版本与发布记录

@dori-ai/dori-side-widget 共发布 412 个版本,首次发布于 2026/02/18;过去 12 个月发布了 412 个版本。

版本发布日期距今
1.13.185latest2026/11/112 天前
1.13.103-dev.20261110180628dev2026/11/112 天前
1.13.103-dev.202611101701152026/11/112 天前
1.13.103-dev.202611101613542026/11/112 天前
1.13.1842026/11/103 天前
1.13.1832026/11/103 天前

关于 @dori-ai/dori-side-widget 的常见问题

@dori-ai/dori-side-widget 是什么?

A modern, responsive chat widget built with React and Chakra UI, designed for seamless integration into any website. The widget provides an AI-powered chat experience with e-commerce capabilities, perfect for customer support and sales assistance.

如何安装 @dori-ai/dori-side-widget?

在项目目录运行 npm install @dori-ai/dori-side-widget,或使用 pnpm add / yarn add / bun add。

@dori-ai/dori-side-widget 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dori-ai__dori-side-widget 是否存在。

@dori-ai/dori-side-widget 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dori-ai/dori-side-widget 可以商用吗?

@dori-ai/dori-side-widget 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@dori-ai/dori-side-widget 的下载量有多少?

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

@dori-ai/dori-side-widget 还在维护吗?

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