Simple JavaScript object to provide static page fetcher and check authentication state.
You need to install this as GitHub repository.
yarn add git+https://github.com/seia-soto/boj-provider
Before starting, you need to create new provider instance with session key:
const Provider = require('boj-provider')
const client = new Provider({
session: 'session key'
})
- You can get your BOJ session key from my another repo.
Returns Promise
of boolean
of login state.
if (await client.isLoggedIn()) {
console.log('Logged in!')
}
Returns Promise
of object
of user profile.
const profile = await client.getProfile()
console.log(profile)
/*
{
identifier: '',
bio: '',
school: '',
email: 'user@domain.tld'
}
*/