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

@superdb/auth-js

v0.1.0

Published

JavaScript/TypeScript client for SuperDB Auth — supabase-js compatible API

Readme

@superdb/auth-js

Cliente JavaScript/TypeScript para o SuperDB Auth. API alinhada com [email protected] por design — para reduzir fricção de migração de projetos Supabase.

Install

npm install @superdb/auth-js
# ou
bun add @superdb/auth-js
# ou
pnpm add @superdb/auth-js

Quickstart

import { createSuperDB } from '@superdb/auth-js';

const sdb = createSuperDB({
  url: 'https://acme.superdb.com.br',
  project: 'acme', // header X-SuperDB-Project (Sprint 2). Custom domain resolve automático.
});

// Email + senha
const { data, error } = await sdb.auth.signUp({
  email: '[email protected]',
  password: 'minhaSenhaForte!2026',
});

// Magic link (link clicável por email)
await sdb.auth.signInWithOtp({ email: '[email protected]' });

// OTP por email (codigo de 6 digitos)
await sdb.auth.signInWithOtp({
  email: '[email protected]',
  options: { channel: 'email' },
});
const verify = await sdb.auth.verifyOtp({
  email: '[email protected]',
  code: '123456',
});

// OAuth (Google / GitHub / Apple)
const { data: oauth } = await sdb.auth.signInWithOAuth({ provider: 'google' });
window.location.href = oauth!.url;

// MFA (TOTP)
const { data: factor } = await sdb.auth.mfa.enroll({ factorType: 'totp', label: 'iPhone' });
// usuario escaneia factor.uri (otpauth://...) com Google Authenticator / 1Password
await sdb.auth.mfa.verify({ factorType: 'totp', code: '123456' });

// Sessao
const { data: { session } } = await sdb.auth.getSession();
const { data: { user } } = await sdb.auth.getUser();
await sdb.auth.refreshSession();
await sdb.auth.signOut();

Storage

Por default: localStorage no browser, MemoryStorage no Node/Bun. Customize com storage:

import { createSuperDB, type SessionStorage } from '@superdb/auth-js';

const cookieStorage: SessionStorage = {
  getItem(k) { return null; /* ler de cookie httpOnly */ },
  setItem(k, v) { /* cookie set */ },
  removeItem(k) { /* cookie clear */ },
};

const sdb = createSuperDB({
  url: 'https://acme.superdb.com.br',
  project: 'acme',
  storage: cookieStorage,
});

SessionStorage aceita retornos sincronos OU Promise para todas as operacoes.

Migrating from @supabase/supabase-js

Use @superdb/client (drop-in replacement):

- import { createClient } from '@supabase/supabase-js';
+ import { createClient } from '@superdb/client';

const client = createClient('https://acme.superdb.com.br', 'anon-key', { project: 'acme' });
const { data } = await client.auth.signInWithPassword({ email, password });

No Sprint 2 apenas client.auth.* esta implementado. client.from, client.storage, client.rpc e client.channel lancam erro com mensagem clara apontando para alternativas.

API

| Metodo | Description | | --- | --- | | auth.signUp(input) | Cria usuario com email+senha (ou phone+senha) | | auth.signInWithPassword(input) | Login com email+senha | | auth.signInWithOtp(input) | Solicita OTP/magic link por email | | auth.verifyOtp({ email, code }) | Verifica codigo OTP | | auth.signInWithOAuth({ provider }) | Inicia fluxo OAuth (google/github/apple) | | auth.signOut(scope?) | Faz logout ('local' default ou 'global') | | auth.refreshSession() | Rotaciona refresh token | | auth.getSession() | Retorna sessao em cache (sem chamar API) | | auth.getUser() | Busca usuario atual via API | | auth.mfa.enroll({ factorType }) | Inscreve TOTP/backup factor | | auth.mfa.verify({ factorType, code }) | Verifica codigo de factor | | auth.mfa.factors() | Lista factors do usuario |

Todas retornam { data, error } ou { data: null, error: AuthError }.

License

MIT — (c) 2026 SuperDB