0auth-sdk

中文文档
0.0.15发布于 2021/12/30MITTypeScriptCommonJS

0auth-js-sdk

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. With react

0auth-sdk

NPM version Type License Downloads

Client Side JavaScript toolkit for 0Auth.

Installation

With npm:

npm install 0auth-sdk

With yarn:

yarn add 0auth-sdk

Usage

With react

Initializing

import Auth from '0auth-sdk';
Auth.initialize({ 
  brand: 'test'
});
optionstyperequiredescription
brandstringtrueset login page link as [brand].0auth.kr

getOptions

Auth.getOptions()

login

// if initialized, push to 0auth login page
Auth.login()

getProfile

// if access token is verified
Auth.getProfile()

版本与发布记录

0auth-sdk 共发布 14 个版本,首次发布于 2021/11/16;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.15latest2021/12/304 年前
0.0.142021/12/304 年前
0.0.132021/11/174 年前
0.0.122021/11/174 年前
0.0.112021/11/174 年前
0.0.92021/11/174 年前

关于 0auth-sdk 的常见问题

0auth-sdk 是什么?

0 auth-js-sdk

如何安装 0auth-sdk?

在项目目录运行 npm install 0auth-sdk,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 log-run,可以用 npx log-run 直接运行。

0auth-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

0auth-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

0auth-sdk 可以商用吗?

0auth-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

0auth-sdk 还在维护吗?

最新版本 0.0.15 发布于 2021/12/30(4 年前);至今共发布 14 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/11/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。