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

@tenshowinnovation/better-auth-cn-plugins

v0.1.0

Published

Better Auth OAuth provider helpers for WeChat and Douyin.

Readme

@tenshowinnovation/better-auth-cn-plugins

Better Auth OAuth provider helpers for WeChat and Douyin.

Install

pnpm add @tenshowinnovation/better-auth-cn-plugins

This package expects better-auth >=1.6.0 <2 to be installed by your app.

Usage

import { betterAuth } from "better-auth";
import { genericOAuth } from "better-auth/plugins";
import { douyin, wechat } from "@tenshowinnovation/better-auth-cn-plugins";

export const auth = betterAuth({
	plugins: [
		genericOAuth({
			config: [
				wechat({
					clientId: process.env.WECHAT_CLIENT_KEY!,
					clientSecret: process.env.WECHAT_CLIENT_SECRET!,
				}),
				douyin({
					clientId: process.env.DOUYIN_CLIENT_KEY!,
					clientSecret: process.env.DOUYIN_CLIENT_SECRET!,
				}),
			],
		}),
	],
});

Better Auth's generic OAuth callback path is:

/api/auth/oauth2/callback/{providerId}

For the default providers, configure these callback paths in the WeChat and Douyin developer consoles:

/api/auth/oauth2/callback/wechat
/api/auth/oauth2/callback/douyin

Provider Notes

  • WeChat clientId is the WeChat appid, and clientSecret is the app secret.
  • Douyin clientId is the Douyin client_key, and clientSecret is client_secret.
  • WeChat defaults to the snsapi_login scope.
  • Douyin defaults to the user_info scope.
  • Both providers generate a fallback email because neither provider reliably returns one.

Fallback Emails

By default, fallback emails use ${accountId}@tempemail.com.

wechat({
	clientId: process.env.WECHAT_CLIENT_KEY!,
	clientSecret: process.env.WECHAT_CLIENT_SECRET!,
	emailDomain: "example.local",
});

You can fully override the generated email:

douyin({
	clientId: process.env.DOUYIN_CLIENT_KEY!,
	clientSecret: process.env.DOUYIN_CLIENT_SECRET!,
	getEmail: (accountId, providerId) => `${providerId}-${accountId}@example.local`,
});

Subpath Imports

import { wechat } from "@tenshowinnovation/better-auth-cn-plugins/wechat";
import { douyin } from "@tenshowinnovation/better-auth-cn-plugins/douyin";