{"id":15122684,"url":"https://github.com/artisancloud/powerwechat","last_synced_at":"2026-01-22T07:20:29.740Z","repository":{"id":37085007,"uuid":"370398434","full_name":"ArtisanCloud/PowerWeChat","owner":"ArtisanCloud","description":"PowerWechat是一款基于WeChat SDK for Golang，支持小程序、微信支付、企业微信、公众号等全微信生态","archived":false,"fork":false,"pushed_at":"2025-04-30T14:55:19.000Z","size":13002,"stargazers_count":1529,"open_issues_count":4,"forks_count":207,"subscribers_count":22,"default_branch":"release/3.3.0","last_synced_at":"2025-04-30T16:00:07.506Z","etag":null,"topics":["go","golang","golang-wechat","js-sdk","jssdk","miniprogram","officialaccounts","payment","sdk","wechat","wechat-sdk","wecom","weixin"],"latest_commit_sha":null,"homepage":"https://powerwechat.artisan-cloud.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtisanCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-24T15:24:09.000Z","updated_at":"2025-04-30T14:56:43.000Z","dependencies_parsed_at":"2024-02-19T15:27:16.297Z","dependency_job_id":"9b02db24-6342-4f57-bb26-848d64bf23f7","html_url":"https://github.com/ArtisanCloud/PowerWeChat","commit_stats":null,"previous_names":["artisancloud/go-wechat","artisancloud/power-wechat"],"tags_count":306,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtisanCloud%2FPowerWeChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtisanCloud%2FPowerWeChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtisanCloud%2FPowerWeChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtisanCloud%2FPowerWeChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtisanCloud","download_url":"https://codeload.github.com/ArtisanCloud/PowerWeChat/tar.gz/refs/heads/release/3.3.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052713,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-wechat","js-sdk","jssdk","miniprogram","officialaccounts","payment","sdk","wechat","wechat-sdk","wecom","weixin"],"created_at":"2024-09-26T02:01:13.552Z","updated_at":"2025-12-30T13:05:34.759Z","avatar_url":"https://github.com/ArtisanCloud.png","language":"Go","readme":"# PowerWeChat SDK\n\n[![Go Build](https://github.com/ArtisanCloud/PowerWeChat/actions/workflows/go-build.yml/badge.svg?branch=release%2F3.0.0)](https://github.com/ArtisanCloud/PowerWeChat/actions/workflows/go-build.yml)\n[![Go Test](https://github.com/ArtisanCloud/PowerWeChat/actions/workflows/go-test.yml/badge.svg?branch=release%2F3.0.0)](https://github.com/ArtisanCloud/PowerWeChat/actions/workflows/go-test.yml)\n\n![star](https://gitcode.com/ArtisanCloud/PowerWechat/star/badge.svg)\n\n你的[Star](https://github.com/ArtisanCloud/PowerWeChat/stargazers \"Star\")，是对我们最好的支持！也是我们坚持的动力！\n\n---\n\nPowerWeChat是一款基于Golang的微信SDK开发框架。目前已经覆盖了微信小程序、企业微信、微信支付等绝大部分场景的API。\n\nPowerWeChat致力于减少微信开发中的各种上手难度，使用者只需要关心API使用，不需要关注底层微信开发中需要用到各种AES加密和解密、签名以及验证，回调通知加解密等。\n\n## 产品特性\n\n* 简易上手，安装一次，全覆盖微信功能接口\n* 开源项目，丰富的文档内容，长期维护\n* 大部分接口已经支持强类型覆盖\n* 完整的测试项目，支持Web API测试\n\n## 快速上手\n\n```bash\ngo get -u github.com/ArtisanCloud/PowerWeChat/v3\n```\n\n示范：初始化实例对象，调用小程序的授权登陆接口\n\n```go\nimport (\n\t\"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram\"\n\t\"os\"\n)\n\n// 1. 初始化小程序应用实例\napp, err := miniProgram.NewMiniProgram(\u0026miniProgram.UserConfig{\n\tAppID:  os.Getenv(\"miniprogram_app_id\"), // 小程序、公众号或者企业微信的appid\n\tSecret: os.Getenv(\"miniprogram_secret\"), // 商户号 appID\n\tHttpDebug: true,\n\tDebug:     false,\n})\n\n// 2. 调用小程序的授权登陆接口\ncode := \"CODE\" // 前端小程序登录时，从微信获取的code\nrs, err := app.Auth.Session(code)\n\nprintf(rs.OpenID)\n```\n\n更多实例接口，请打开[官方文档](https://powerwechat.artisan-cloud.com/zh/start/)\n\n## 文档以及使用示例\n\n* [官网文档](https://powerwechat.artisan-cloud.com/zh/start/) ：全面的接口文档，方便用户查找，使用我们开发的sdk功能\n* [使用示例](https://github.com/ArtisanCloud/power-wechat-tutorial) ：您可以通过Tutorial来了解到PowerWeChat的配置和使用\n\n  ps: 我们单独写了一个项目 [PowerWechatTutorial](https://github.com/ArtisanCloud/power-wechat-tutorial) ，基本上覆盖了大部分常用的API使用，希望能够帮助大家更快的上手Golang WeChat开发。\n\n\n### 版本升级描述(V2-\u003eV3) \n* 接口添加context参数\n* 解决v2的自动refresh token问题\n\n### 如果你觉得这个项目对你有帮助，可以请作者喝杯咖啡\n\u003cimg src=\"https://powerwechat.artisan-cloud.com/assets/receive_code.3KAeHaPN.jpg\" alt=\"请扫我\" style=\"display:inline; width: 150px;\"/\u003e\n\n### 感谢打赏者，对该项目的支持\n\u003ca href=\"https://github.com/qindj\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/1707762?v=4\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/jhonor777\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/31689092?v=4\"\u003e\n\u003c/a\u003e\n\n# 视频教程\n\n### [快速上手](https://www.bilibili.com/video/BV1tN411u7pV/)\n\n\n### [框架设计](https://www.bilibili.com/video/BV15C4y1m7vM/)\n\n\n### [公众号使用](https://www.bilibili.com/video/BV1iN41157g3/?vd_source=1d120f41ee7b1be77aa8cceff5d5628f)\n\n\n### [小程序使用](https://www.bilibili.com/video/BV1eu4y1H7H4/?vd_source=1d120f41ee7b1be77aa8cceff5d5628f)\n\n\n### [企业微信使用](https://www.bilibili.com/video/BV1tb4y1T7Ng/?vd_source=1d120f41ee7b1be77aa8cceff5d5628f)\n\n\n### API快速导航\n\n* 公众号\n\t* [入门](https://powerwechat.artisan-cloud.com/zh/official-account/index.html)\n\t* [基础接口](https://powerwechat.artisan-cloud.com/zh/official-account/base.html)\n\t* [服务端](https://powerwechat.artisan-cloud.com/zh/official-account/server.html)\n\t* [消息](https://powerwechat.artisan-cloud.com/zh/official-account/messages.html)\n\t* [多客服消息转发](https://powerwechat.artisan-cloud.com/zh/official-account/message-transfer.html)\n\t* [消息群发](https://powerwechat.artisan-cloud.com/zh/official-account/broadcasting.html)\n\t* [用户](https://powerwechat.artisan-cloud.com/zh/official-account/user.html)\n\t* [用户标签](https://powerwechat.artisan-cloud.com/zh/official-account/user-tag.html)\n\t* [网页授权](https://powerwechat.artisan-cloud.com/zh/official-account/oauth.html)\n\t* [JSSDK](https://powerwechat.artisan-cloud.com/zh/official-account/jssdk.html)\n\t* [二维码](https://powerwechat.artisan-cloud.com/zh/official-account/qrcode.html)\n\t* [短Key托管](https://powerwechat.artisan-cloud.com/zh/official-account/shorten.html)\n\t* [临时素材](https://powerwechat.artisan-cloud.com/zh/official-account/media.html)\n\t* [素材管理](https://powerwechat.artisan-cloud.com/zh/official-account/material.html)\n\t* [菜单](https://powerwechat.artisan-cloud.com/zh/official-account/menu.html)\n\t* [卡券 ](https://powerwechat.artisan-cloud.com/zh/official-account/card.html)\n\t* [客服](https://powerwechat.artisan-cloud.com/zh/official-account/customer-service.html)\n\t* [摇一摇周边](https://powerwechat.artisan-cloud.com/zh/official-account/shake-around.html)\n\t* [数据统计](https://powerwechat.artisan-cloud.com/zh/official-account/data-cube.html)\n\t* [自动回复](https://powerwechat.artisan-cloud.com/zh/official-account/reply.html)\n\t* [评论数据管理](https://powerwechat.artisan-cloud.com/zh/official-account/comment.html)\n\t* [返佣商品](https://powerwechat.artisan-cloud.com/zh/official-account/goods.html)\n* 开放平台\n    * [导读](https://powerwechat.artisan-cloud.com/zh/open-platform/intro.html) \n    * [基本概念](https://powerwechat.artisan-cloud.com/zh/open-platform/basic.html) \n    * [应用场景](https://powerwechat.artisan-cloud.com/zh/open-platform/scene.html)\n    * [入门](https://powerwechat.artisan-cloud.com/zh/open-platform/index.html)\n    * [服务端](https://powerwechat.artisan-cloud.com/zh/open-platform/server.html)\n    * [代授权](https://powerwechat.artisan-cloud.com/zh/open-platform/authorizer-delegate.html)\n* 小程序\n\t* [用户信息](https://powerwechat.artisan-cloud.com/zh/mini-program/user-info.html)\n\t* [数据统计与分析](https://powerwechat.artisan-cloud.com/zh/mini-program/statistics.html)\n\t* [客服消息](https://powerwechat.artisan-cloud.com/zh/mini-program/service-message.html)\n\t* [统一服务消息](https://powerwechat.artisan-cloud.com/zh/mini-program/uniform-message.html)\n\t* [动态消息](https://powerwechat.artisan-cloud.com/zh/mini-program/updatable-message.html)\n\t* [插件管理](https://powerwechat.artisan-cloud.com/zh/mini-program/plugin.html)\n\t* [小程序码](https://powerwechat.artisan-cloud.com/zh/mini-program/miniprogram-code.html)\n\t* [消息解密](https://powerwechat.artisan-cloud.com/zh/mini-program/decode-message.html)\n\t* [内容安全](https://powerwechat.artisan-cloud.com/zh/mini-program/content-security.html)\n\t* [生物认证](https://powerwechat.artisan-cloud.com/zh/mini-program/verify-signature.html)\n\t* [附近的小程序](https://powerwechat.artisan-cloud.com/zh/mini-program/nearby-miniprogram.html)\n\t* [订阅消息](https://powerwechat.artisan-cloud.com/zh/mini-program/subscription-message.html)\n\t* [服务市场](https://powerwechat.artisan-cloud.com/zh/mini-program/service-market.html)\n\t* [直播](https://powerwechat.artisan-cloud.com/zh/mini-program/live.html)\n\t* [安全风控](https://powerwechat.artisan-cloud.com/zh/mini-program/risk-control.html)\n\t* [URL Scheme](https://powerwechat.artisan-cloud.com/zh/mini-program/url-scheme.html)\n* 微信支付\n    * [入门](https://powerwechat.artisan-cloud.com/zh/payment/)\n    * [订单](https://powerwechat.artisan-cloud.com/zh/payment/order.html)\n    * [退款](https://powerwechat.artisan-cloud.com/zh/payment/refund.html)\n    * [对账单](https://powerwechat.artisan-cloud.com/zh/payment/bill.html)\n    * [通知](https://powerwechat.artisan-cloud.com/zh/payment/notification.html)\n    * [红包 v2](https://powerwechat.artisan-cloud.com/zh/payment/red-pack.html)\n    * [JSSDK](https://powerwechat.artisan-cloud.com/zh/payment/jssdk.html)\n    * [企业付款 v2](https://powerwechat.artisan-cloud.com/zh/payment/work-pay.html)\n    * [商户付款](https://powerwechat.artisan-cloud.com/zh/payment/merchant-pay.html)\n    * [撤销订单](https://powerwechat.artisan-cloud.com/zh/payment/retrieve-order.html)\n    * [分账](https://powerwechat.artisan-cloud.com/zh/payment/profit-share.html)\n* 企业微信\n\t* [服务端](https://powerwechat.artisan-cloud.com/zh/wecom/server.html)\n\t* [应用管理](https://powerwechat.artisan-cloud.com/zh/wecom/agent.html)\n\t* [消息发送](https://powerwechat.artisan-cloud.com/zh/wecom/message.html)\n\t* [通讯录](https://powerwechat.artisan-cloud.com/zh/wecom/contacts.html)\n\t* [网页授权](https://powerwechat.artisan-cloud.com/zh/wecom/web-auth.html)\n\t* [客户联系](https://powerwechat.artisan-cloud.com/zh/wecom/external-contact.html)\n\t* [微信客服](https://powerwechat.artisan-cloud.com/zh/wecom/customer-service.html)\n\t* [临时素材](https://powerwechat.artisan-cloud.com/zh/wecom/media.html)\n\t* [OA](https://powerwechat.artisan-cloud.com/zh/wecom/oa.html)\n\t* [会话内容存档](https://powerwechat.artisan-cloud.com/zh/wecom/session.html)\n\t* [电子发票](https://powerwechat.artisan-cloud.com/zh/wecom/e-invoice.html)\n\t* [小程序](https://powerwechat.artisan-cloud.com/zh/wecom/mini-program.html)\n\t* [JSSDK](https://powerwechat.artisan-cloud.com/zh/wecom/jssdk.html)\n\t* [群机器人](https://powerwechat.artisan-cloud.com/zh/wecom/robot.html)\n\t* [移动端](https://powerwechat.artisan-cloud.com/zh/wecom/mobile.html)\n\n更多内容请在[官方文档](https://powerwechat.artisan-cloud.com/zh/start/) 里面进行查阅。\n\n\n## 产品诞生背景\n团队也是很多同学一样，从 PHP 转向 Golang，具体为什么，有什么好处，就不用我这里多介绍了吧。 但是现在因为微信的生态做私域化管理是得天独厚，所以我们公司也开发了蛮多企业微信的功能。只是在转型 golang 的过程中，没有找到像 （[easywechat](https://easywechat.com)）这样好用的 sdk。所以我们就自己想为 golang 的同学们做一点贡献。产品会长期维护，迭代，希望同学们有兴趣在使用的过程中，多给意见。\n\n\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ArtisanCloud/PowerWeChat\u0026type=Date)](https://star-history.com/#ArtisanCloud/PowerWeChat\u0026Date)\n\n\n\u003c!-- 相关产品推荐 --\u003e\n## 相关产品推荐\n\n[PowerX 基于PowerWechat的客域系统](https://github.com/ArtisanCloud/PowerX)  \n[WeyUI 一套微信生态前端组件库，适配PowerX非常友好](https://github.com/yaoyaochil/WeyUI)  \n[BaiduTrans 百度翻译Go-SDK，AIGC后台提词翻译神器](https://github.com/ArtisanCloud/BaiduTrans)\n\n\u003c!-- CONTRIBUTORS --\u003e\n## Contributors\n\n特别感谢 \u003ca href=\"https://github.com/northseadl\"\u003eNorthseadl\u003c/a\u003e为版本3所做的贡献\n\n\u003ca href=\"https://github.com/northseadl\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/99570485?v=4\"\u003e\n\u003c/a\u003e\n\n---\n\n\n\u003ca href=\"https://github.com/AlvinQinwen\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/40420020?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/yosink\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/10346255?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/mryangjiang\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/23132307?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/zhou7507\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/51078932?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/jeffid\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/22427722?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/bugstark\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/29302590?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/sohenk\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/5018122?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/YangCSir\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/21410207?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/obe007\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/16457340?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/panw3i\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/16938611?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/tesun\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/36953434?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/liyiwu\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/895138?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/erlangzhang\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/782958?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/GJHaoo\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/31203943?v=4\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/beijibeijing\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/34858346?v=4\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/tss-tss\"\u003e\n  \u003cimg width=\"50\" src=\"https://avatars.githubusercontent.com/u/76192676?v=4\"\u003e\n\u003c/a\u003e\n\n\n\n\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/ArtisanCloud/PowerWeChat/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=ArtisanCloud/PowerWechat\" /\u003e\n\u003c/a \u003e\n\n\n\n\n## 联系我们\n\n如果有任何意见，欢迎在Github Issue上提供意见反馈。同时，也欢迎扫描下方二维码加入微信讨论群。\n\n\n\n\n## 产品主要维护者\n\nMichael Hu\n\n申请添加好友时，请备注产品名称，比如：“我关注PowerWechat”\n\n\u003cimg src=\"https://powerx.artisan-cloud.com/assets/contact-qr-matrix-x.f35142ca.jpg\" alt=\"请扫我\" style=\"display:inline; width: 150px;\"/\u003e\n\nNorth Wang\n\n\u003cimg src=\"https://powerx.artisan-cloud.com/assets/contact_qr_north.d68f0fd0.jpg\" alt=\"请扫我\" style=\"display:inline; width: 150px;\"/\u003e\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartisancloud%2Fpowerwechat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartisancloud%2Fpowerwechat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartisancloud%2Fpowerwechat/lists"}