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

@agg-market/auth

v14.0.0

Published

Composable auth UI and provider adapters for the [AGG](https://agg.market) SDK.

Readme

@agg-market/auth

Composable auth UI and provider adapters for the AGG SDK.

This package keeps provider-specific auth integrations out of @agg-market/ui. Use it when you want AGG’s connect/sign-in UX with only the auth methods your app actually installs.

Install

Base install:

npm install @agg-market/sdk @agg-market/hooks @agg-market/ui @agg-market/auth

Add only the auth peers you need:

# SIWE / Ethereum
npm install wagmi

# SIWS / Solana
npm install @solana/wallet-adapter-react bs58

Quick start

import "@agg-market/ui/styles.css";
import { AggProvider } from "@agg-market/hooks";
import { createAggClient } from "@agg-market/sdk";
import {
  AggAuthProvider,
  ConnectButton,
  createAppleAuthMethod,
  createEmailAuthMethod,
  createGoogleAuthMethod,
} from "@agg-market/auth";
import { useSiweAuthMethod } from "@agg-market/auth/siwe";
import { WagmiProvider } from "wagmi";
import { wagmiConfig } from "./wagmi-config";

const client = createAggClient({
  appId: "your-app-id",
  baseUrl: "https://api.agg.market",
});

function AuthButton() {
  const siwe = useSiweAuthMethod({
    statement: "Sign in to AGG",
  });

  return (
    <AggAuthProvider
      methods={[siwe, createGoogleAuthMethod(), createAppleAuthMethod(), createEmailAuthMethod()]}
    >
      <ConnectButton />
    </AggAuthProvider>
  );
}

export function App() {
  return (
    <WagmiProvider config={wagmiConfig}>
      <AggProvider client={client}>
        <AuthButton />
      </AggProvider>
    </WagmiProvider>
  );
}

AggAuthProvider automatically checks the current callback URL on mount. For redirect-based auth providers, it reads the code query parameter, calls client.exchangeAuthCode(code), and then cleans the callback URL through the shared hooks layer.

Available adapters

| Import path | Export | Notes | | ----------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------- | | @agg-market/auth | createAppleAuthMethod() | Redirect-based OAuth | | @agg-market/auth | createGoogleAuthMethod() | Redirect-based OAuth | | @agg-market/auth | createTwitterAuthMethod() | Redirect-based OAuth | | @agg-market/auth | createEmailAuthMethod() | Magic-link email flow | | @agg-market/auth/siwe | useSiweAuthMethod() | Requires wagmi | | @agg-market/auth/siws | useSiwsAuthMethod() | Requires @solana/wallet-adapter-react + bs58; signs raw UTF-8 bytes and base58-encodes the signature |

Redirect callback routes

If your app uses a dedicated callback page, you can hydrate the redirect callback explicitly:

import { useAggAuthCallback } from "@agg-market/auth";

export function AuthCallbackPage() {
  const { error, isHandled, isHandling, user } = useAggAuthCallback();

  if (isHandling) return <p>Finishing sign-in…</p>;
  if (error) return <p>{error.message}</p>;
  if (isHandled) return <p>Signed in as {user?.id}</p>;

  return <p>No AGG auth callback data was found.</p>;
}

This uses the documented redirect recipe:

  1. parse the code query parameter from the callback URL
  2. call client.exchangeAuthCode(code)
  3. remove code from the URL via window.history.replaceState(...)

Migration from @agg-market/ui

Older versions exposed an auth-centric ConnectButton from @agg-market/ui. That coupling has been removed.

  1. Keep AggProvider from @agg-market/hooks
  2. Add AggAuthProvider from @agg-market/auth
  3. Move ConnectButton imports to @agg-market/auth
  4. Install only the provider peers your enabled methods need:
    • wagmi for SIWE
    • @solana/wallet-adapter-react and bs58 for SIWS
    • no wallet packages for Google, Apple, Twitter, or email

Architecture

  • @agg-market/sdk owns auth API calls and session token storage.
  • @agg-market/hooks owns shared auth/session state inside AggProvider.
  • @agg-market/ui stays generic and ships reusable UI primitives only.
  • @agg-market/auth owns auth method adapters plus the connect/sign-in UX.

License

MIT