Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seia-soto/boj-provider
Simple JavaScript object to provide static page fetcher and check authentication state.
https://github.com/seia-soto/boj-provider
Last synced: about 11 hours ago
JSON representation
Simple JavaScript object to provide static page fetcher and check authentication state.
- Host: GitHub
- URL: https://github.com/seia-soto/boj-provider
- Owner: seia-soto
- License: mit
- Created: 2021-06-05T15:13:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T17:26:47.000Z (over 3 years ago)
- Last Synced: 2024-11-05T16:57:48.766Z (about 2 months ago)
- Language: JavaScript
- Size: 662 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# boj-provider
Simple JavaScript object to provide static page fetcher and check authentication state.
## Table of Contents
- [Installation](#installation)
- [API](#api)----
# Installation
You need to install this as GitHub repository.
```sh
yarn add git+https://github.com/seia-soto/boj-provider
```# API
Before starting, you need to create new provider instance with session key:
```js
const Provider = require('boj-provider')const client = new Provider({
session: 'session key'
})
```- You can get your BOJ session key from [my another repo](https://github.com/seia-soto/boj-userspace-login).
## isLoggedIn
Returns `Promise` of `boolean` of login state.
```js
if (await client.isLoggedIn()) {
console.log('Logged in!')
}
```## getProfile
Returns `Promise` of `object` of user profile.
```js
const profile = await client.getProfile()console.log(profile)
/*
{
identifier: '',
bio: '',
school: '',
email: '[email protected]'
}
*/
```