avanta
v1.0.5
Published
๐ The backbone for auth, simplifying the OAuth process for developers.
Downloads
23
Readme
๐ญ Use with NPM
- Install the package
npm install avanta- Import the package
const Avanta = require('avanta');
// or
import Avanta from 'avanta';- Use it
const avt = new Avanta({
providers: {
my_discord_provider: {
client_id: env.CLIENT_ID,
client_secret: env.CLIENT_SECRET,
},
my_google_provider: {
client_id: env.CLIENT_ID,
client_secret: env.CLIENT_SECRET,
}
}
});
// Providers are type-safe and autocompleted!
const googleOAuthLink = avt
.providers
.my_google_provider
.getOAuthLink(
"http://localhost:3000/auth/google",
[
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
],
"myState",
);๐ฅ Features
- Multiple providers for the same service
- Generating OAuth links, getting tokens, getting information from tokens.
- Type-safe and autocompleted providers
๐ Supported Services (just for now)
- Discord
๐๏ธ WIP
- Getting new access tokens from refresh tokens
- Documentation
- And many more providers and features!
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
