Skip to content

loulin/wechat

Repository files navigation

@weixin-sdk

微信 Node.js SDK Monorepo - 提供微信全平台 API 集成

CI License: MIT

📦 包列表

包名 描述 NPM
@weixin-sdk/core 共享核心模块 -
@weixin-sdk/mp 公众号/服务号 API -
@weixin-sdk/open 开放平台第三方平台 -
@weixin-sdk/open-service 开放平台服务集成 -
@weixin-sdk/auth Express OAuth 中间件 -

🚀 快速开始

安装

# 使用 pnpm(推荐)
pnpm add @weixin-sdk/mp

# 使用 npm
npm install @weixin-sdk/mp

示例

import { WechatAuth } from '@weixin-sdk/auth';

const auth = new WechatAuth({
  appid: 'wx...',
  appsecret: '...',
});

// 获取授权 URL
const url = auth.getAuthorizeURL('https://example.com/callback', 'snsapi_userinfo');

// 处理回调
const token = await auth.getAccessToken(code);
const user = await auth.getUserInfo(token.access_token, token.openid);

🛠️ 开发

查看 贡献指南 了解开发和发布流程。

pnpm install   # 安装依赖
pnpm build     # 构建
pnpm test      # 测试
pnpm lint      # 代码检查

📖 文档

文档开发中...

📄 许可证

MIT © Lin Lou

About

Wechat News Editor

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors