# micro-app-auth

> wechat microApp or other microApp user Auth lib

Latest version **1.0.2** (published 2023-08-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install micro-app-auth
pnpm add micro-app-auth
yarn add micro-app-auth
bun add micro-app-auth
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-08-11 |
| First published | 2023-08-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lu xi |
| Maintainers | lu_xi |
| Keywords | micro-app-auth |

## Links

- npm: https://www.npmjs.com/package/micro-app-auth
- Repository: https://github.com/Lupeiwen0/micro-app-auth
- Homepage: https://github.com/Lupeiwen0/micro-app-auth#readme
- Issues: https://github.com/Lupeiwen0/micro-app-auth/issues
- npm.io page: https://npm.io/package/micro-app-auth

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-08-11
- 1.0.1 — 2023-08-04
- 1.0.0 — 2023-08-04

## README

# micro-app-auth
WeChat microApp or other microApp user Auth lib

## example

```ts
// for wx
import CheckAuthClient, {Config, ExecuteOptions} from 'micro-app-auth'

// of second params, is current microApp platform, or wx or tt or ...
const checkAuthClient = new CheckAuthClient({ scope: 'userLocation' }, wx)


/**
 * or execute location API
 * checkAuthClient ==> execute
 */
checkAuthClient.execute({
  success(res) {
    console.log(res)
  },
  fail(err) {
    console.log(err)
  }
})

/**
 * check userLocation auth
 * when of record auth, you should use tt.getRecorderManager.start()
 * This is more suitable for you to use
 */
async function getLocation() {
  await checkAuthClient.checkAuth()
  wx.getLocation({
    success: res => console.log(res)
  })
}
```

---
_Source: https://npm.io/package/micro-app-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
