# solid-authing

> solid and authing all in one

Latest version **0.0.2** (published 2018-12-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install solid-authing
pnpm add solid-authing
yarn add solid-authing
bun add solid-authing
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-12-02 |
| First published | 2018-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Authing |
| Maintainers | ivydom |
| Keywords | authing, solid |

## Links

- npm: https://www.npmjs.com/package/solid-authing
- Repository: https://github.com/Authing/solid-authing
- Homepage: https://github.com/Authing/solid-authing#readme
- Issues: https://github.com/Authing/solid-authing/issues
- npm.io page: https://npm.io/package/solid-authing

## Dependencies (2)

- [authing-js-sdk](https://npm.io/package/authing-js-sdk.md) ^1.1.7
- [solid-auth-client](https://npm.io/package/solid-auth-client.md) ^2.2.13

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-12-02
- 0.0.1 — 2018-12-01

## README

# solid-authing

`solid-authing` 集成了 [Solid](https://solid.inrupt.com) 和 [Authing](https://authing.cn) 的功能，登录/注册 Authing 等同于登录/注册 Solid。

`solid-authing` 使用 Authing 官方架设的 Solid Pod: [solid.authing.cn](https://solid.authing.cn)。

## 安装

``` shell
$ npm install solid-authing --save
```

## 使用

只能用于浏览器端，目前还处于 beta 版，可能会有不稳定，请暂时不要将此框架用于生产环境。

### 注册

``` javascript
const main = async () => {
    const solidAuthing = new SolidAuthing({
        clientId: 'client_id',
        secret: 'client_secret',
    });

    const sa = await solidAuthing.getAuthingInsatance(); //必须调用

    const userInfo = await sa.register();
}
main();
```

### 登录

``` javascript
const main = async () => {
    const solidAuthing = new SolidAuthing({
        clientId: 'client_id',
        secret: 'client_secret',
    });

    const sa = await solidAuthing.getAuthingInsatance(); //必须调用

    const userInfo = await sa.login();
}
main();
```

### 退出

``` javascript
const main = async () => {
    const solidAuthing = new SolidAuthing({
        clientId: 'client_id',
        secret: 'client_secret',
    });

    const sa = await solidAuthing.getAuthingInsatance(); //必须调用

    const userInfo = await sa.logout();
}
main();
```

### 获取 Solid 实例

调用完 `getAuthingInsatance` 后可以使用 `solid`。

``` javascript
const main = async () => {
    const solidAuthing = new SolidAuthing({
        clientId: 'client_id',
        secret: 'client_secret',
    });

    const sa = await solidAuthing.getAuthingInsatance(); //必须调用

    // sa.solid...

    sa.solid.fetch('https://leinue.solid.authing.cn/public/test.html')
    .then((response) => {
        return response.text();
    })
    .then((data) => {
        // 打出 test.html 的网页内容
        console.log(data);
    });
}
main();
```

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