@unservice/wechat-token-service
v0.2.2
Published
![NPM Version](https://img.shields.io/npm/v/@unservice/wechat-token-service)
Downloads
12
Readme
Wechat token service
The simplest and most lightweight WeChat access token maintenance library
- A server for maintaining WeChat access token
- A RPC client to get WeChat access token from the server
Run server
// app.ts
import { createServer } from '@unservice/wechat-token-service'
const app = createServer({
appId: '',
appSecret: '',
apiDomain: '',
})
export default app
Use bun
bun run app.ts
Use client
const client = createClient('server origin')
const token = await client.token.$get().then((res) => res.text())
Authentication
As you like!