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

tgo-widget-miniprogram

v1.1.1

Published

TGO visitor chat widget for WeChat Mini Program

Readme

tgo-widget-miniprogram

TGO 访客聊天微信小程序组件。开发者 3 步完成接入。

快速接入

1. 安装

npm install tgo-widget-miniprogram

在微信开发者工具中点击 工具 → 构建 npm

2. 页面配置

// pages/chat/chat.json
{
  "usingComponents": {
    "tgo-chat": "tgo-widget-miniprogram/chat/index"
  },
  "navigationBarTitleText": "在线客服"
}

3. 使用组件

<!-- pages/chat/chat.wxml -->
<tgo-chat api-key="ak_live_xxx" api-base="https://your-api.com" />

跳转到客服页

wx.navigateTo({ url: '/pages/chat/chat' })

域名白名单

在小程序管理后台配置以下域名:

| 类型 | 域名 | |------|------| | request 合法域名 | API 服务域名 | | socket 合法域名 | WuKongIM WSS 域名 | | uploadFile 合法域名 | API 服务域名 | | downloadFile 合法域名 | API 服务域名 |

组件属性

| 属性 | 类型 | 必填 | 默认值 | 说明 | |------|------|------|--------|------| | api-key | String | 是 | — | 平台 API Key | | api-base | String | 是 | — | API 服务地址 | | theme-color | String | 否 | #2f80ed | 主题色 | | lang | String | 否 | zh | 语言(zh/en) | | visitor-name | String | 否 | — | 访客名称 | | visitor-avatar | String | 否 | — | 访客头像 URL | | custom-attrs | Object | 否 | — | 自定义访客属性 |

功能支持

  • 文本消息收发
  • AI 流式回复(实时逐字显示)
  • 图片消息发送与预览
  • 历史消息加载(上拉加载更多)
  • 系统消息展示(客服接入/转接/结束)
  • Markdown 渲染(加粗、斜体、链接、列表、代码块)
  • 多语言支持(中文/英文)
  • IM 断线自动重连

开发

# 构建 miniprogram_dist
npm run build

构建产物位于 miniprogram_dist/,微信开发者工具通过 package.jsonminiprogram 字段读取此目录。