npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@austinsdk/auth

v1.1.1

Published

Austin SDK - Authentication helper for Austin SDK services

Readme

Austin SDK for Node.js

Hey there! Welcome to the Austin SDK authentication helper. This little library makes it super easy to connect your Node.js apps with our awesome auth system.

What's this all about?

If you're building an app that needs to authenticate users through auth, this SDK handles all the OAuth for you.

Getting Started

First, grab the package:

npm install @austinsdk/auth

Then you're ready to go:

const Auth = require('@austinsdk/auth');

// Set up your auth client with your app's credentials
const auth = new Auth(
    'https://auth.austinsdk.me',        // The auth server URL
    'your-client-id',                   // Your app's client ID
    'your-client-secret',               // Your app's client secret (keep this safe!)
    'https://yourapp.com/callback'      // Where users get sent after auth
);

How to use it

Step 1: Send users to login

When someone wants to log into your app, redirect them to the auth URL:

// This creates a URL that sends users to Austin's login page
const authUrl = auth.getAuthUrl();

// Optional: use a different redirect URL for this specific request
const customAuthUrl = auth.getAuthUrl('https://yourapp.com/special-callback');

console.log('Send your user here:', authUrl);

Step 2: Exchange the code for a token

After users log in, they'll be redirected back to your app with a special code. Trade that code for an access token:

// Assuming you got the code from the URL parameter
const code = 'the-code-from-the-redirect';

try {
    const tokenResponse = await auth.codeForToken(code);
    console.log('Got a token!', tokenResponse.access_token);
} catch (error) {
    console.log('Oops, something went wrong:', error);
}

Step 3: Do cool stuff with the token

Now you can get user info and their projects:

const token = tokenResponse.access_token;

// Get info about the logged-in user
const userInfo = await auth.getUserInfo(token);
console.log('Hello,', userInfo.name || userInfo.username);

// Get their projects
const projects = await auth.getProjects(token);
console.log(`You have ${projects.length} projects!`);

// Check if the token is still valid
const verification = await auth.verify(token);
if (verification.valid) {
    console.log('Token looks good!');
} else {
    console.log('Time to refresh that token...');
}

API Reference

new Auth(url, client_id, client_secret, redirect_uri)

Creates a new authentication client.

  • url: The base URL for Austin's auth server
  • client_id: Your application's client ID
  • client_secret: Your application's client secret (keep this secure!)
  • redirect_uri: Where users should be sent after authentication

auth.getAuthUrl(redirect_uri?)

Returns the URL to send users to for authentication.

  • redirect_uri (optional): Override the default redirect URI

auth.codeForToken(code, redirect_uri?)

Exchanges an authorization code for an access token.

  • code: The authorization code from the callback
  • redirect_uri (optional): Must match the one used in getAuthUrl

auth.getUserInfo(token)

Gets information about the authenticated user.

  • token: The access token

auth.getProjects(token)

Gets the user's projects.

  • token: The access token

auth.verify(token)

Checks if a token is valid.

  • token: The access token to verify

Requirements

  • Node.js 14 or higher
  • An application registered with Austin's platform

Getting Help

Something not working? Found a bug? Have a question?

License

MIT License - feel free to use this in your projects!


Made with ❤️ by Austin's SDK