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

@varshylinc/auth-social

v0.2.4

Published

Drop-in authentication for Capacitor + web apps: Apple, Google, and email/password sign-in with sessions, password reset, a show/hide toggle, and your own user store via an adapter.

Readme

@varshylinc/auth-social

Drop-in authentication for Capacitor + web apps: Apple, Google, and email/password sign-in with sessions, password reset, a show/hide toggle, and your own user store via an adapter.

npm license

Part of the Varshyl Toolkit — a set of independent, composable packages for building Capacitor + web SaaS apps.

Screenshots

Ready-made sign-in screen with Google and email/password — drop it into your app and theme it.

Sign-in screen with Google button, email and password fields, and a show/hide password toggle

Tap the eye icon to reveal or hide the password — helpful on mobile keyboards.

Password field with the visibility toggle showing plain text

Forgot-password and reset-password screens ship with the package — wire your adapter’s email sender and you’re done.

Forgot password screen — user enters email to receive a reset link

Reset password screen — user sets a new password from the email link

What it does

Handles sign-in and sign-up for mobile and web apps without owning your user table. You implement a small adapter for your existing user store; the module manages credentials, OAuth identities, sessions, and password-reset tokens in its own Postgres tables. Ships ready-made React screens with platform-aware social buttons (Apple on iOS, Google on Android/web) and an email/password flow with a password visibility toggle.

Install

npm install @varshylinc/auth-social

Peer dependencies: pg (server) and react (client).

For native Apple/Google sign-in on device builds, install @capgo/capacitor-social-login and import the Capgo provider from @varshylinc/auth-social/client/capgo. Web and CI builds can use the built-in mock provider — no native SDK required.

Quick start

Server — run migrations, create the auth service, mount your routes:

import { Pool } from 'pg';
import { createAuthService, runMigrations } from '@varshylinc/auth-social';
import type { AuthUserAdapter } from '@varshylinc/auth-social';

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
await runMigrations(pool);

const adapter: AuthUserAdapter = {
  findUserByEmail: (email) => yourDb.findByEmail(email),
  createUser: (input) => yourDb.createUser(input),
  getUserById: (id) => yourDb.getUser(id),
  sendPasswordResetEmail: ({ to, resetUrl }) => yourMailer.send(to, resetUrl),
};

const auth = createAuthService(pool, adapter, {
  resetUrlBase: 'https://yourapp.com/reset-password',
});

Client — configure once, render the sign-in screen:

import { configureAuth, SignInScreen, useAuth, setAuthTheme } from '@varshylinc/auth-social/client';

configureAuth({ apiBaseUrl: '/api/auth' });
setAuthTheme({ primary: '#2563eb' });

function LoginPage() {
  const { actions } = useAuth();
  return (
    <SignInScreen
      actions={actions}
      onSuccess={() => (window.location.href = '/app')}
    />
  );
}

Entry points

| Import path | Exports | |---|---| | @varshylinc/auth-social | createAuthService, runMigrations, MIGRATIONS_DIR, verifyAppleIdToken, verifyGoogleIdToken, createMockAuthService, types | | @varshylinc/auth-social/client | configureAuth, useAuth, SignInScreen, ForgotPasswordScreen, ResetPasswordScreen, AuthField, authActions, setAuthTheme, createMockSocialProvider, … | | @varshylinc/auth-social/client/capgo | createCapgoSocialProvider — native Apple/Google via Capgo (optional peer) |

Database

Bring your own Postgres. Call runMigrations(pool) on server boot — idempotent, safe every startup. Tables use the as_ prefix (as_credentials, as_oauth_identities, as_sessions, as_password_resets). Requires citext and pgcrypto extensions.

Theming

Themeable via setAuthTheme() or configureAuth({ theme }). Ships a neutral default (DEFAULT_AUTH_THEME).

See also

License

Apache-2.0 © Vagish Kapila / Varshyl Inc.