0.0.1 • Published 5 years ago
oaun v0.0.1
Oaun
Quick Start
npm install --save oaun
Import components like:
import { DiscordAuth } from 'oaun'
Usage
import { DiscordAuth } from 'oaun';
const CLIENT_ID = 'The client id of your app';
const CLIENT_SECRET = 'The client secret of your app';
const CLIENT_SCOPES = ['identify'] // A Array of scope that you need
const CLIENT_REDIRECT = 'http://localhost:3000/login/callback'; // The redirect URL of your app
// Setup the button
// "mybutton" is here either the id or the class of my button
const auth = new DiscordAuth('mybutton', {
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
scopes: CLIENT_SCOPES,
redirect_uri: CLIENT_REDIRECT
})
auth.login() // Open popup to login
.then(user => {
console.log(user);
})
.catch(error => {
console.log(error);
})
Developpement
Oaun plan
Here is a plan of what Oaun should contain:
- GoogleAuth
- FacebookAuth
- TwitterAuth
- DiscordAuth
- GithubAuth
- GitlabAuth
- BitbucketAuth
- ShareAuth
What Oaun is supposed to be:
- A 0 dependencies package
- A easy and fast component to use (plug & play component)
What Oaun is not supposed to be:
- A server-side librairy
Contributing
- Clone this repo: git clone https://github.com/Olyno/oaun.git
- Install dependencies:
npm i
License
Code released under GNU license.
Copyright ©, Olyno.
0.0.1
5 years ago