Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 1.75 KB

README.md

File metadata and controls

84 lines (63 loc) · 1.75 KB

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

🍭 Use with NPM

  1. Install the package
npm install avanta
  1. Import the package
const Avanta = require('avanta');
// or 
import Avanta from 'avanta';
  1. 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
  • Google

🏗️ 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.

Packaged with 💝 by nitLix