Revolutionary tool for developers who hate writing tons of code to use OAuth, but want the flexibility that Auth.js takes away.
<1.0.4> Packaged with 💝 by nitLix ⠀
- 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",
);
- Multiple providers for the same service
- Generating OAuth links, getting tokens, getting information from tokens.
- Type-safe and autocompleted providers
- Discord
- Getting new access tokens from refresh tokens
- Documentation
- And many more providers and features!
This project is licensed under the MIT License - see the LICENSE file for details.
Packaged with 💝 by nitLix ⠀