seia-soto / boj-provider

Simple JavaScript object to provide static page fetcher and check authentication state.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

boj-provider

Simple JavaScript object to provide static page fetcher and check authentication state.

Table of Contents


Installation

You need to install this as GitHub repository.

yarn add git+https://github.com/seia-soto/boj-provider

API

Before starting, you need to create new provider instance with session key:

const Provider = require('boj-provider')

const client = new Provider({
  session: 'session key'
})

isLoggedIn

Returns Promise of boolean of login state.

if (await client.isLoggedIn()) {
  console.log('Logged in!')
}

getProfile

Returns Promise of object of user profile.

const profile = await client.getProfile()

console.log(profile)

/*
{
  identifier: '',
  bio: '',
  school: '',
  email: 'user@domain.tld'
}
*/

About

Simple JavaScript object to provide static page fetcher and check authentication state.

License:MIT License


Languages

Language:JavaScript 100.0%