socialiteproviders/wechat-web
WeChat Web OAuth provider for Laravel Socialite, enabling "Sign in with WeChat" for websites. Adds WeChat as a Socialite driver with minimal setup so you can authenticate users and fetch their profile via the WeChat Open Platform.
Market-entry and login-funnel decisions for China-facing web products. This package is the Laravel/Socialite glue for WeChat Open Platform "website application" login (网站应用 — the QR-code "scan to sign in" flow on open.weixin.qq.com). It lets you answer, cheaply, whether WeChat sign-in moves your activation and registration-conversion numbers for mainland users. WeChat is the de facto "Sign in with Google" for that market; without it you are asking users to create yet another password.
Specifically, it informs:
openid vs. unionid. The Open Platform flow returns a unionid when your app is bound to a WeChat Open Platform account, which is what lets you stitch one human across your website, official account, and mini program. Deciding whether you need a cross-channel identity graph is a product decision this integration forces early — and it is the single most consequential one, because retrofitting identity later is expensive.Use cases it fits: PC web sign-in for mainland consumers, B2B portals where employees/customers authenticate via WeChat, cross-border commerce storefronts targeting Chinese buyers, and account-linking for existing users who already have a WeChat identity.
Consider it when all of these are true:
Socialite::driver('weixinweb') ergonomics — no bespoke auth plumbing.unionid.Look elsewhere when:
socialiteproviders/wechat), a different app type, and different scopes (snsapi_base vs. snsapi_userinfo). Buying the wrong one is the most common failure mode here.The practical middle path most teams take: copy the driver into your own app/Socialite/ namespace, wrap it behind your own WeChatAuthenticator interface, and keep the swap to EasyWeChat a one-file change. At this package's size, that is cheaper than the governance overhead of adding a dependency.
To executives: WeChat is how roughly a billion people log into things. If our roadmap includes any China-facing web product, "sign in with WeChat" is table stakes, not a differentiator — users bounce at a password form. This package lets us test that hypothesis in days rather than weeks, for effectively zero licensing cost. The strategic value is the learning, not the code: it tells us whether WeChat-authenticated users convert, and it forces us to decide early whether we need a unified cross-channel identity (unionid) — a decision that is cheap now and very expensive after launch.
To engineering: It is a thin Socialite OAuth2 driver for the WeChat Open Platform QR-login flow. Standard redirect / callback pattern, state handled by Socialite, openid/unionid plus basic profile on the callback. Caveats: released 2020, 29 stars, so we treat it as fork-and-own — pin it, vendor or copy it into our namespace, add tests around the callback and token exchange, and put it behind our own interface so we can migrate to EasyWeChat without touching call sites. WeChat tokens are short-lived (access token ~2h, refresh ~30d); we persist what we need for identity and do not rely on the provider for long-lived session management.
To security/compliance: The integration collects a Chinese-market persistent identifier plus profile data. That triggers PIPL consent copy, ICP filing for the callback domain, and a data-flow review on where we store unionid. The dependency itself is small and auditable — the risk is maintenance, not surface area, and we are mitigating it by owning the fork.
Bottom line: Low cost, low commitment, high information value — adopt it as a scoped spike with an explicit expiry date, not as a permanent platform decision.
How can I help you explore Laravel packages today?