open-index/open-npm huggingface dataset:
npm package: @plusauth/plusauth-oidc-client-js
Description: OpenID Connect (OIDC) and OAuth2 library for browser based JavaScript applications.
Latest version: 0.12.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

## @plusauth/plusauth-oidc-client-js
<a href="https://github.com/PlusAuth/plusauth-oidc-client-js/actions?query=workflow%3Aci">
<img src="https://github.com/PlusAuth/plusauth-oidc-client-js/workflows/ci/badge.svg" alt="Build Status">
</a>
<a href="https://www.npmjs.com/package/@plusauth/plusauth-oidc-client-js">
<img alt="npm" src="https://img.shields.io/npm/v/@plusauth/plusauth-oidc-client-js?label=latest%20&logo=npm&style=flat-square">
</a>
<a href="https://www.npmjs.com/package/@plusauth/plusauth-oidc-client-js">
<img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/min/@plusauth/plusauth-oidc-client-js@latest?label=minified%20size&style=flat-square">
</a>
<a href="https://www.npmjs.com/package/@plusauth/plusauth-oidc-client-js">
<img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@plusauth/plusauth-oidc-client-js@latest?color=darkgreen&label=minzipped%20size&style=flat-square">
</a>
<a href="https://codecov.io/gh/PlusAuth/plusauth-oidc-client-js">
<img alt="Codecov" src="https://img.shields.io/codecov/c/gh/PlusAuth/plusauth-oidc-client-js?logo=codecov&style=flat-square">
</a>
<a href="https://snyk.io/test/github/PlusAuth/plusauth-oidc-client-js">
<img src="https://img.shields.io/snyk/vulnerabilities/github/PlusAuth/plusauth-oidc-client-js?style=flat-square" alt="Vulnerabilities">
</a>
<a href="https://github.com/PlusAuth/plusauth-oidc-client-js/blob/master/LICENSE">
<img alt="license" src="https://img.shields.io/npm/l/@plusauth/plusauth-oidc-client-js?style=flat-square">
</a>

OpenID Connect (OIDC) and OAuth2 library for browser based JavaScript applications.

### Features
- Silent Authentication
- Automatic Access Token Renewal
- [Session Management](https://openid.net/specs/openid-connect-session-1_0.html) (with logout functionality)
- [PKCE](https://tools.ietf.org/html/rfc7636)
- JWT payload validation
- Can be used with any OpenID Connect provider
- Cross tab login synchronization

### Table of Contents
- [Installation](#installation)
- [Documentation](#documentation)
- [Api Docs](#api-docs)
- [Examples](#examples)


### Installation

From the CDN:

```html
<script src="https://unpkg.com/@plusauth/plusauth-oidc-client-js@0.11.0/dist/plusauth-oidc-client.umd.js"></script>

```

Using [npm](https://npmjs.org):

```sh
npm install @plusauth/plusauth-oidc-client-js
```

or [yarn](https://yarnpkg.com):

```sh
yarn add @plusauth/plusauth-oidc-client-js
```

### Documentation
Documentation is served on PlusAuth documentation site. You can reach it from [here](https://docs.plusauth.com/tools/oidc-client-js)

### Api Docs

Please visit [here](https://plusauth.github.io/plusauth-oidc-client-js/classes/OIDCClient.html)


### Examples

Have a look at [examples directory](/examples) for various examples
npm package: @plusauth/plusauth-rest-js
Description: PlusAuth JavaScript Rest Client
Author: Ismail H. Ayaz
Latest version: 2.4.0

# @plusauth/plusauth-rest-js

Helper library for interacting with PlusAuth REST API intent upon to be used in NodeJS and browser environments.

Table Of Content
1. [Installation](#installation)
2. [Usage](#usage)
3. [Docs](#docs)
4. [Examples](#examples)


# Installation
From PlusAuth CDN:
```html
<!-- Latest release -->
<script src="https://unpkg.com/@plusauth/plusauth-rest-js@2.3.0/dist/plusauth-rest-js.iife.js"></script>
```

With npm:
```shell script
$ npm install @plusauth/plusauth-rest-js
```

or with yarn
```shell script
$ yarn add @plusauth/plusauth-rest-js
```

# Usage

## Browser (CDN Usage)
The library will be exposed to global as `PlusAuthRestClient`

Initialize it like following:
```js
const authToken = '<ACCESS_TOKEN>'
const plusAuth = PlusAuthRestClient('https://<YOUR_TENANT_ID>.plusauth.com', { token: authToken })
```

## ESM (Modern Bundlers)
```js
import { PlusAuthRestClient } from '@plusauth/plusauth-rest-js'

const authToken = '<ACCESS_TOKEN>'
const plusAuth = new PlusAuthRestClient('https://<YOUR_TENANT_ID>.plusauth.com', { token: authToken })
```

## CommonJS
```js
const { PlusAuthRestClient } = require('@plusauth/plusauth-rest-js')

const authToken = '<ACCESS_TOKEN>'
const plusAuth = new PlusAuthRestClient('https://<YOUR_TENANT_ID>.plusauth.com', { token: authToken })
```

## Replacing Token
Generally you may need to replace PlusAuth REST API token because its lifetime could end.
In this case updating `options.token` or by using the `token` setter
of PlusAuthClient instance will be enough to change used token.

> To generate access token consult [docs](https://docs.plusauth.com/api/core/authorization) or have a look at [example/getAuthToken.js](./example/getAuthToken.js).
The example file also includes an example curl request.

```js
const initialToken = 'INITIAL_TOKEN'
const plusAuth = new PlusAuthRestClient('https://<YOUR_TENANT_ID>.plusauth.com', { token: initialToken })

plusAuth.users.getAll().then( function (res){
// retrieved with initial token
console.log(res)
})

// or: plusauth.options.token = 'NEW_TOKEN'
plusAuth.token = 'NEW_TOKEN'

plusAuth.users.getAll().then(function (res){
// Retrieved with new token
console.log(res)
})
```

## Custom HTTP Client
You may provide your own http client to the library when you need to have more control over your requests.

```js
const axios = require('axios')
const plusAuth = new PlusAuthRestClient('https://<YOUR_TENANT_ID>.plusauth.com', {
    httpClient: function (url, options) {
        options.url = url
        options.data = options.body
        return axios(options)
    }
})
```

# Docs
For API docs visit [here](https://docs.plusauth.com/api/core)
npm package: @plusauth/plusauth-widget
Description: Web widget for rendering PlusAuth views
Latest version: 0.41.1

## @plusauth/plusauth-widget

<p align="center">
 <img src="/stories/public/assets/preview.png" height="450"/>
</p>

This widget is a helper for rendering PlusAuth views. Please have a look at [Documentation](https://plusauth.github.io/plusauth-widget/)
npm package: @plusauth/web
Description: PlusAuth Web Util
Author: Ismail H. Ayaz
Latest version: 0.4.2

# @plusauth/web
PlusAuth helper utility intended to use in browsers.

## Table of Contents
1. [Installation](#installation)
2. [Usage](#usage)
3. [Docs](#docs)


## Installation
From PlusAuth CDN (Make sure to check version):
```html
<!-- Latest release -->
<script src="https://unpkg.com/@plusauth/web@0.3.1/dist/plusauth-web.umd.js"></script>
```

With npm:
```shell script
$ npm install @plusauth/web
```

or with yarn
```shell script
$ yarn add @plusauth/web
```

# Usage

## CDN Usage
The library will be exposed to global as `plusauthweb`

Initialize it like following:
```js
const plusAuth = new plusauthweb.PlusAuthWeb('https://<YOUR_TENANT_ID>.plusauth.com')

// access auth methods
plusAuth.auth.signIn({ username: 'test', password: 'test' })

// access mfa methods
plusAuth.mfa.validateCode('CODE', plusauthweb.MFACodeType.SMS)
```

## NPM Usage
```js
import { PlusAuthWeb, MFACodeType } from '@plusauth/web'

const plusAuth = new PlusAuthWeb('https://<YOUR_TENANT_ID>.plusauth.com')

// access auth methods
plusAuth.auth.signIn({ username: 'test', password: 'test' })

// access mfa methods
plusAuth.mfa.validateCode('CODE', MFACodeType.SMS)
```

# Docs
For API docs visit [here](https://plusauth.github.io/plusauth-web/classes/plusauthweb.html)
npm package: @pluschong/console-overlay
Description: 在控制台更好的显示console内容
Author: pluschong
Latest version: 0.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @pluschong/console-overlay

> Console 日志美化工具

二次封装 console，提供美化的日志输出，保持 log 一致性。适用于需要统一日志格式、提升控制台输出可读性的场景。

---

## 安装

```bash
npm install @pluschong/console-overlay
# 或者
pnpm add @pluschong/console-overlay
# 或者
yarn add @pluschong/console-overlay
```

## 使用方法

```ts
import { consoleSrv } from '@pluschong/console-overlay';

// 错误信息（红色）
consoleSrv.error('ErrorTag', { message: 'Something went wrong' });

// 警告信息（黄色）
consoleSrv.warn('WarnTag', { data: 'Warning message' });

// 调试信息（可自定义颜色）
consoleSrv.info('InfoTag', { info: 'Debug info' });
consoleSrv.info('InfoTag', { info: 'Custom color' }, 'blue');

// 自定义输出
consoleSrv.custom({ message: 'Custom log' }, 'arg1', 'arg2');
```

## API 说明

### consoleSrv.error(tag: string, err: any)
输出错误信息（红色标签）

### consoleSrv.warn(tag: string, data: any)
输出警告信息（黄色标签）

### consoleSrv.info(tag: string, data: any, color?: string)
输出调试信息，可选自定义颜色

### consoleSrv.custom(info: any, ...args: any[])
自定义输出格式

### consoleSrv.setConfig(config: Partial<SrvCfg>)
配置日志开关
```ts
consoleSrv.setConfig({
  enableError: false,  // 关闭错误日志
  enableInfo: false    // 关闭调试日志
});
```

## 特性说明

- 🎨 美化的日志输出格式
- 📝 统一的日志样式
- 🔧 保持与原生 console API 的兼容性
- 📦 轻量级，无额外依赖

## 注意事项

- 本工具仅用于美化控制台输出，不影响原生 console 功能。
- 建议在开发环境使用，生产环境可根据需求选择。

## License

MIT
npm package: @pluschong/safe-type
Description: 通过暴露封装后的any，来规避lint中禁止any的报错
Author: pluschong
Latest version: 0.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.


# @pluschong/safe-type

> TypeScript 通用类型库

许多项目的 lint 规则会禁止使用 `any`，但在实际开发中某些场景难以避免，或为了降低临时工作量会选择使用 `any`。为此，本库提供一组常用的 TypeScript 通用类型，方便在必要时统一处理并减少 lint 报错。注意：这些类型本质上仍相当于 `any`，会降低类型安全性，仅在确有必要时使用，并优先采用更精确的类型定义以遵循项目的 TypeScript 规范。

---

## 安装

```bash
npm install @pluschong/safe-type
# 或者
pnpm add @pluschong/safe-type
# 或者
yarn add @pluschong/safe-type
```

## 使用方法

```ts
import type { SafeAny, SafeArray, SafeObject, SafeTimer } from '@pluschong/safe-type';

function example(a: SafeAny): SafeArray {
	const arr: SafeArray = [a, 1, 'test'];
	return arr;
}

const obj: SafeObject = { foo: 1, bar: 'baz' };

let timer: SafeTimer;
timer = setTimeout(() => {}, 1000);
timer = setInterval(() => {}, 1000);
```

## 类型说明

- `SafeAny`：等价于 `any`，用于特殊场景下绕过类型检查。
- `SafeArray`：等价于 `any[]`，任意类型数组。
- `SafeObject`：键为 `string | number`，值为 `any` 的对象。
- `SafeTimer`：`setTimeout` 或 `setInterval` 返回值。

## 注意事项

- 这些类型仅用于特殊场景，建议优先使用更严格的类型定义。
- 滥用这些类型会降低 TypeScript 的类型安全性。

## License

MIT
npm package: @pluschong/utils
Description: 通用工具库
Author: pluschong
Latest version: 0.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @pluschong/utils

> JavaScript/TypeScript 通用工具函数库

提供一套经过实践验证的工具函数集合，涵盖日期处理、数字运算、防抖节流、深拷贝、表单验证等常用场景，帮助开发者提升开发效率。

---

## 安装

```bash
npm install @pluschong/utils
# 或者
pnpm add @pluschong/utils
# 或者
yarn add @pluschong/utils
```

## 功能模块

### 📅 日期工具 (date)

基于 dayjs 封装的日期处理工具。

```ts
import { format, diff, countdown, dateIsToday } from '@pluschong/utils/date';

// 格式化日期
format(new Date(), 'YYYY-MM-DD HH:mm:ss');

// 计算日期差
diff('2024-12-31', '2024-01-01', 'day'); // 364

// 倒计时
countdown('2024-12-31 23:59:59').subscribe(time => {
  console.log(time); // { day: '30', hour: '12', min: '30', sec: '45' }
});

// 判断是否今天
dateIsToday(new Date()); // true
```

### ⏱️ 防抖 (debounce)

防止函数在短时间内被频繁调用，只执行最后一次。

```ts
import { debounce } from '@pluschong/utils/debounce';

const debounceSrv = debounce();

// 用户停止输入后才搜索
input.addEventListener('input', () => {
  debounceSrv.start(() => {
    search(input.value);
  }, 300);
});
```

### 🔄 节流 (throttle)

限制函数的执行频率，固定时间内只执行一次。

```ts
import { throttle } from '@pluschong/utils/throttle';

const throttleSrv = throttle();

// 滚动事件节流
window.addEventListener('scroll', () => {
  throttleSrv.start(() => {
    updateScrollPosition();
  }, 200);
});
```

### 🔢 数字工具 (number)

基于 decimal.js 的精确数字运算。

```ts
import { add, subtract, multiply, divide } from '@pluschong/utils/number';

// 避免浮点数精度问题
add(0.1, 0.2); // 0.3 (而不是 0.30000000000000004)
multiply(0.1, 0.2); // 0.02
```

### 📋 深拷贝 (deep)

深度复制对象或数组。

```ts
import { deepClone } from '@pluschong/utils/deep';

const original = { a: 1, b: { c: 2 } };
const cloned = deepClone(original);
cloned.b.c = 3; // 不会影响 original
```

### ✅ 表单验证 (validate)

常用的表单验证函数。

```ts
import { isEmail, isPhone, isIdCard } from '@pluschong/utils/validate';

isEmail('test@example.com'); // true
isPhone('13800138000'); // true
isIdCard('110101199001011234'); // true
```

## 依赖要求

- **rxjs**: ^7.0.0 (用于倒计时功能，需在项目中安装)

## 注意事项

- 日期处理默认使用中文语言环境
- 数字运算使用 decimal.js 保证精度
- 倒计时功能依赖 RxJS，使用前需确保项目已安装 rxjs

## License

MIT