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

@onebots/adapter-google-chat

v0.1.11

Published

OneBots Google Chat API 与 Google Workspace Events 适配器

Readme

@onebots/adapter-google-chat

Google Chat REST v1, Chat interaction HTTPS, and Google Workspace Events adapter for OneBots.

实现基线为当前官方稳定 Google Chat REST v1 与 Workspace Events API;开发者预览能力不会被声明为稳定能力。

特性

  • 可嵌入 GoogleChatClient,支持 interaction-http、pubsub-push、manual;
  • ingest(rawEvent)、结构化 ingestHttp() 与 Fetch acceptHttp(Request) 共用可靠去重管线;
  • 验证 Google Chat OIDC/self-signed JWT 与 Pub/Sub push OIDC 身份,失败不会 ACK;
  • 自动展开 Workspace batch event,严格解析外部 JSON 和 resource name;
  • 消息、编辑、删除、历史、Space、成员、reaction、附件、read state 与 availability 原生动作;
  • call(method, relativePath, options) 覆盖当前稳定 REST v1,拒绝绝对 URL 与路径穿越;
  • downloadMedia(resourceName) 以 Uint8Array 下载上传附件,不把二进制伪装成 JSON;
  • Interaction 入口可通过 interactionResponse 返回文本、卡片或 dialog 结构化响应。

Standalone client

import { GoogleChatClient } from "@onebots/adapter-google-chat";

const client = new GoogleChatClient({
  account_id: "chat-app",
  auth_mode: "access-token",
  access_token: process.env.GOOGLE_CHAT_ACCESS_TOKEN,
  receive_mode: "manual",
  principal_name: "users/me",
});

client.on("event", async envelope => {
  await handleGoogleChatEvent(envelope);
});

await client.start();
await client.ingest(rawInteractionOrCloudEvent);

const attachment = await client.downloadMedia("spaces/AAA/attachments/file-id");

English

The fully typed client never opens its own port. Existing Koa/Fetch hosts and Pub/Sub receivers can pass authenticated requests to ingestHttp() or acceptHttp(), while an existing connection can use ingest(). Delivery is committed only after every asynchronous listener succeeds, so upstream retries remain safe.

See the Chinese platform guide or English platform guide.