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

wechat-package

v1.0.5

Published

企业微信SDK工具包,提供用户验证、JS-SDK配置和语音处理功能

Readme

Wechat Enterprise SDK

企业微信SDK工具包,提供用户验证、JS-SDK配置和语音处理功能。

安装

npm install wechat-enterprise-sdk

使用方法

基本使用

import { WechatEnterpriseSDK } from 'wechat-enterprise-sdk';

// 创建SDK实例
const sdk = new WechatEnterpriseSDK({
  authUrl: 'https://your-auth-server.com',
  devUserId: 'ZhangKeJie', // 开发环境用户ID
  redirectUri: 'wechatai.gyjm.com.cn/auth-loading' // 重定向URI
});

// 用户验证
const userId = sdk.userValidate();

// 获取JS-SDK配置
const jsConfig = await sdk.getWechatJsConfig(window.location.href);

// 获取语音base64数据
const voiceData = await sdk.getVoiceBase64('media_id_here');

函数式使用(兼容旧版本)

import { userValidate, getWechatJsConfig, getVoiceBase64 } from 'wechat-enterprise-sdk';

const options = {
  authUrl: 'https://your-auth-server.com',
  devUserId: 'ZhangKeJie',
  redirectUri: 'wechatai.gyjm.com.cn/auth-loading'
};

const userId = userValidate(options);
const jsConfig = await getWechatJsConfig(options, window.location.href);
const voiceData = await getVoiceBase64(options, 'media_id_here');

API 文档

WechatEnterpriseSDK

构造函数

new WechatEnterpriseSDK(options: WechatEnterpriseOptions)

方法

userValidate(): UserValidationResult

用户验证方法,返回用户ID或跳转到授权页面。

getWechatJsConfig(url: string): Promise

获取企业微信JS-SDK配置签名。

getVoiceBase64(mediaId: string): Promise

获取企业微信语音素材的base64数据。

updateOptions(newOptions: Partial): void

更新配置选项。

getOptions(): WechatEnterpriseOptions

获取当前配置。

配置选项 (WechatEnterpriseOptions)

| 参数 | 类型 | 必填 | 描述 | |------|------|------|------| | authUrl | string | 是 | 认证服务器URL | | devUserId | string | 否 | 开发环境用户ID,默认 'ZhangKeJie' | | redirectUri | string | 否 | 重定向URI,默认 'wechatai.gyjm.com.cn/auth-loading' |

开发

# 安装依赖
npm install

# 开发模式(监听文件变化)
npm run dev

# 构建生产版本
npm run build

# 运行测试
npm run test

发布

# 构建并发布到npm
npm run build
npm publish

许可证

MIT License

支持

如有问题,请提交 Issue 或联系开发团队。