otherLive

Capacitor Auth Manager

com.aoneahsan.capacitorauthmanager

Capacitor Auth Manager is a framework-agnostic TypeScript authentication library that unifies 15 OAuth, passwordless, credential, and biometric sign-in flows behind one provider-less API for React, Vue, Angular, vanilla JS, and optional Capacitor mobile apps.

2024-06 โ†’ PresentOpen Source

At a glance

Category
other
Status
Live
Started
Jun 2024
Last updated
2 months ago

Identifier

com.aoneahsan.capacitorauthmanager

Preview

No embedded preview for this one

Not every project has a public web surface that can be framed โ€” a package, a native app and a store-only extension have nothing to embed, and several sites refuse framing outright. The links above go to the real thing.

Nothing to embed here

A preview is wired per project, and this one has no framable public URL on record.

Back to all projects

About

What this actually is

Fifteen ways to sign in, and a product needs about three of them.

Which three is the part nobody knows at the start. A founder wants Google because everybody already has one, then the first enterprise conversation asks for Microsoft, then support asks for a magic link because a user cannot remember which button they pressed the last time.

Each of those is a week.

Not a week of difficult work. A week of reading one provider's console, finding where it disagrees with the last one, and writing the fourth version of the same token-refresh code you have already written in other codebases.

Capacitor Auth Manager exists because I had written it more than once.

It is one singleton, one provider-configuration model and one auth-state contract, and it behaves the same way in React, Vue, Angular or plain JavaScript. There is no context provider to wrap your tree in. You import it and read it, the way a Zustand store works.

That is why it can be adopted a screen at a time.

The provider list runs to fifteen. Google, Microsoft, Facebook, GitHub, Slack and LinkedIn cover the OAuth side, Firebase covers the projects already standing on it, and then there are the three that are not OAuth at all: password, one-time codes with magic links, and biometric sign-in.

Security is where a library like this either earns its place or quietly loses it.

Manual OAuth flows run real S256 PKCE rather than the plain variant that is easier to implement and protects nothing. An ID token is checked for its nonce and its expiry rather than decoded and believed. Secure storage is an interface, so where a token actually sits is your decision instead of mine. The browser biometric fallback encrypts with AES-GCM.

Then there is the part the documentation says out loud.

A client library cannot be your security boundary. It can run a ceremony correctly and hand you a result; whether that result deserves trust is a question for your server, and no amount of code on this side of the line answers it. That admission costs adoption. It is worth it, because the alternative is a developer who believes the wrong thing about their own login.

What it cost was the boring half: a 79-test suite, clean ESM, CommonJS and browser builds, and zero lint warnings held as a condition rather than a target.

The standing cost is different, and it never goes away.

Fifteen providers is fifteen surfaces somebody else controls. A provider renames a scope, retires an endpoint or tightens a redirect rule, and that failure arrives in my inbox rather than in a compiler, usually from somebody whose users cannot sign in this morning.

The honest version of the maintenance answer is a method rather than a promise. A fix publishes as a new version in the same pass that produced it. That is how every package here is handled, and it is all one maintainer can truthfully offer.

The optional native plugin covers Android. There is no iOS release behind any of this, because there is no Apple Developer account here.

It is on npm as capacitor-auth-manager under MIT, with the source at github.com/aoneahsan/capacitor-auth-manager.

Read the section on client-side limits first. It is the part most authentication libraries leave you to discover on your own, usually at the moment when discovering it has already become expensive to act on.

Worth knowing

  • One core, many frameworks: every adapter (React/Vue/Angular/vanilla) is a thin shell over the same auth manager โ€” identical behavior, error codes, and account-management surface across stacks.
  • Provider-less by design: no React context, no Angular `forRoot` ceremony required for basic use โ€” it behaves like a global store, which keeps component trees clean.
  • All 15 providers share one base class: the v2.3.0 F-39 refactor pulled the last 7 hand-rolled providers onto `BaseAuthProvider`, so construction/state/capability logic is unified โ€” with dual-signature constructors preserving both the registry path and `new XProvider(config)` with zero public-API change.
  • Honest security posture: the package explicitly states it does NOT verify ID-token signatures in the browser and that default `localStorage` is XSS-readable โ€” pushing users toward server-side validation and injected secure storage rather than over-promising.
  • Type-safety milestone (v2.4.0): eliminated all 37 `no-explicit-any` warnings (lint now 0/0) by making `StorageInterface` generic and typing the Angular adapter + registry payloads, while finishing the ESLint 9โ†’10 flat-config migration โ€” a pure-quality release with no runtime change.
  • Lean dependency surface: a single runtime dependency (`tslib`); everything framework-specific is an *optional* peer, so a vanilla-JS consumer pulls in nothing extra and tree-shaking ships only the providers actually called.
  • Zero-cost, MIT, free: no paid tiers, no backend lock-in; backend-dependent providers (GitHub exchange, SMS, magic-link, email/password) are clearly flagged so teams know exactly where server support is required.
  • Tree-shakeable: `sideEffects: false` + dynamic provider imports mean apps only ship the providers they actually call.

Built with

  • TypeScript
  • CapacitorJS
  • Rollup
  • React 19
  • Vue
  • Angular

Key features

What it does, and what that costs to build

Each of these is a capability the stack genuinely provides. None of them is an outcome nobody measured โ€” there is no "cut onboarding by 40%" on this page, because no one measured onboarding.

  • 15 sign-in providers behind one provider-less API
  • Framework-agnostic (React/Vue/Angular/vanilla JS)
  • S256 PKCE + OIDC nonce/exp validation
  • AES-GCM biometric web fallback
  • Pluggable secure storage interface
  • Optional native Capacitor plugin (iOS/Android)
  • Tree-shakeable ESM/CJS/browser bundles

Screenshots

5 slots, 2 of them filled in

These are designed frames, not pictures. Each one records what belongs in the slot and at what width; the capture itself is taken from the running app. Drawing a fake screenshot here would put an image on the site that no build has ever produced.

Timeline

Still being worked on

  1. Jun 2024

    Work started

    The earliest month on record for Capacitor Auth Manager.

  2. Sep 2026

    Last change

    Status is completed โ€” 2 months ago. Ongoing, so this row moves whenever something lands.

Questions

Common questions

The questions that actually arrive, answered in the first sentence.

Who built Capacitor Auth Manager, and who maintains it?
Ahsan Mahmood, working alone, and he is the person who answers an issue on it. That is the honest maintenance picture: one maintainer, no company behind the package, and a fix that publishes as a new npm version in the same pass that produced the fix. It is on npm as capacitor-auth-manager under MIT, with the source at github.com/aoneahsan/capacitor-auth-manager. What is not on offer is a support commitment, because a promise about future availability is not one that a single maintainer can make honestly.
Which sign-in methods does it cover?
Fifteen providers behind one API: the OAuth set including Google, Microsoft, Facebook, GitHub, Slack and LinkedIn, then Firebase, then the three that are not OAuth at all, which are password, one-time codes with magic links, and biometric sign-in. The count is not the interesting part. Adding a fourth sign-in method to a live product becomes a configuration change instead of another week spent reading a provider console, and that week is the real cost this removes.
Does Capacitor Auth Manager work on iPhone?
The OAuth flows are HTTP redirects, so they run in any browser, an iPhone browser included, because none of that is platform code. The optional native plugin covers Android. There is no iOS release behind this work, because there is no Apple Developer account here and nothing I build has shipped to the App Store. So the accurate reading is web everywhere, native on Android, and no claim of any kind about what happens inside an Apple review queue.
Do I have to wrap my application in a provider component?
No. There is no context provider and no higher-order component to add; the library is a singleton you import and read, in the way a Zustand store works. That is what makes it adoptable one screen at a time rather than as a rewrite, and it is why the same package behaves identically in React, Vue, Angular and plain JavaScript. It builds to ESM, CommonJS and a browser bundle, and it is tree-shakeable, so a project using three providers does not carry the other twelve.
What does this library deliberately not do?
It does not make your client the security boundary, and the documentation says that out loud rather than implying otherwise. A client library can run an authentication ceremony correctly and hand you a result; deciding whether that result may be trusted belongs to your server, and no code on the browser side of the line changes it. It also does not host anything, hold state on your behalf, or replace the provider consoles where scopes and redirect URIs live. Those stay in your accounts, which is the version of this where you are not locked in.

Keep looking

More from the catalogue

  • NA

    Native Update

    com.aoneahsan.nativeupdate

    Over-the-air updates for Capacitor apps โ€” bundle signing, staged rollout, and automatic rollback when a bundle fails to boot twice.

    completedFeatured
  • ST

    Strata Storage

    com.aoneahsan.stratastorage

    One storage API across localStorage, IndexedDB, cookies, the URL, native Keychain and Keystore, SQLite and the filesystem. Zero dependencies.

    completedFeatured
  • ZT

    ZTools

    com.zaions.ztools

    A privacy-first developer and power-user toolbox covering 20 categories, where the work happens in your browser rather than on someone's server.

    completedFeatured
All 23 projects