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

antarctic

v0.6.0

Published

High-level OAuth 2.0 clients for popular providers, forked from Arctic

Readme

Antarctic

Antarctic is a fork of Arctic by pilcrowOnPaper, adding a high level auth layer on top of its OAuth 2.0 clients. Only the authorization code flow is supported. Built on top of the Fetch API, it's light weight, fully-typed, and runtime-agnostic.

All of the OAuth 2.0 clients and provider coverage are Arctic's work. If you only need those, use Arctic directly. See credits.

npm install antarctic

High-level API

Construct a provider with an options object and get two methods that handle the whole flow: getAuthorizationURL() and getUser(). State and PKCE values are generated for you and kept in a polystore compatible key-value store.

import * as auth from "antarctic";
import kv from "polystore";

const store = kv(new Map());
const scopes = ["read:user", "user:email"];

const github = new auth.GitHub({ store, scopes });

// Redirect the user here to sign in.
const { url } = await github.getAuthorizationURL();

// In the OAuth callback route:
const user = await github.getUser(request.url);
// { id: "1", name: "The Octocat", email: "[email protected]", image: "https://..." }

getAuthorizationURL() returns { url, state, payload }. The state and payload are already in the store, so you only need url unless you would rather persist them yourself.

getUser() accepts the callback query as a full URL, a query string, a URLSearchParams, or a plain object. It validates the state, exchanges the code (with PKCE where the provider supports it), fetches the profile, deletes the consumed state, and returns the user along with the tokens: { id, name, email, image, raw, accessToken, refreshToken, scopes }.

Pass the state back as a second argument to skip the store entirely, for example when you keep it in a signed cookie:

const { url, state, payload } = await github.getAuthorizationURL();
// ...later, in the callback route
const user = await github.getUser(request.url, { state, payload });

Options resolve as explicit > environment > provider default. Every option except store can come from the environment, named after the provider:

GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
GITHUB_REDIRECT_URI
GITHUB_SCOPES

GOOGLE_CLIENT_ID
...

GITHUB_SCOPES takes a list separated by commas, whitespace, or both. Scopes resolve as argument > constructor > environment > provider default, where the provider default is the minimal set that yields a full profile:

await github.getAuthorizationURL(["repo"]); // overrides the constructor and the environment

The environment is read when the provider is constructed, so load your .env file first. See the documentation for the details.

Errors thrown by the high-level layer: InvalidOAuthStateError, InvalidOAuthCallbackError, OAuthConfigurationError, and OAuthProviderError.

Sessions, cookies, and your user database remain your responsibility: take the returned user and plug it into your framework of choice.

Low-level API

Arctic's low level API remains available on the same objects, including the positional constructors. It is unchanged except that PKCE providers build the URL asynchronously, so createAuthorizationURL() returns a promise for them:

import * as arctic from "antarctic";

const github = new arctic.GitHub(clientId, clientSecret, redirectURI);

const state = arctic.generateState();
const scopes = ["user:email"];
const authorizationURL = github.createAuthorizationURL(state, scopes);

// ...

const tokens = await github.validateAuthorizationCode(code);
const accessToken = tokens.accessToken();

Antarctic only supports providers that follow the OAuth 2.0 spec (including PKCE and token revocation).

Credits

Antarctic is a fork of Arctic, created and maintained by pilcrowOnPaper. The OAuth 2.0 clients, the provider implementations, the docs those pages grew from, and the design that makes all of it consistent are their work. Antarctic adds one layer on top: getAuthorizationURL(), getUser(), and the option resolution around them.

Arctic is MIT licensed. Antarctic keeps that license and the original copyright notice, and adds its own for the new work. See LICENSE.

If you only need the OAuth 2.0 clients without the high level layer, use Arctic directly. Please report provider issues that are not specific to Antarctic's additions upstream, where they benefit everyone.

Semver

Antarctic does not strictly follow semantic versioning. While we aim to only introduce breaking changes in major versions, we may introduce them in a minor update if a provider updates their API in a non-backward compatible way. However, they will never be introduced in a patch update.

Supported providers

  • 42 School
  • Amazon Cognito
  • AniList
  • Apple
  • Atlassian
  • Auth0
  • Authentik
  • Autodesk Platform Services
  • Battle.net
  • Bitbucket
  • Box
  • Bungie
  • Coinbase
  • Discord
  • DonationAlerts
  • Dribbble
  • Dropbox
  • Etsy
  • Epic Games
  • Facebook
  • Figma
  • Gitea
  • GitHub
  • GitLab
  • Google
  • Intuit
  • Kakao
  • KeyCloak
  • Kick
  • Lichess
  • Line
  • Linear
  • LinkedIn
  • Mastodon
  • MercadoLibre
  • MercadoPago
  • Microsoft Entra ID
  • MyAnimeList
  • Naver
  • Notion
  • Okta
  • osu!
  • Patreon
  • Polar
  • Reddit
  • Roblox
  • Salesforce
  • Shikimori
  • Slack
  • Spotify
  • Start.gg
  • Strava
  • Synology
  • TikTok
  • Tiltify
  • Tumblr
  • Twitch
  • Twitter
  • VK
  • WorkOS
  • Yahoo
  • Yandex
  • Zoom