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

@0xobelisk/controller

v0.2.10

Published

Modal SDK for partner user login/authentication.

Readme

Dubhe Auth Modal SDK (@0xobelisk/controller)

npm version License: MIT

Modal SDK that projects can embed for user login/auth. Published as @0xobelisk/controller, with ESM/CJS/UMD outputs and adapters for React, Vue, Svelte, Solid, Preact, Angular, and Cocos Creator.

📚 Documentation

Complete Integration Guide →

Platform-specific guides available for:

  • React / Next.js
  • Vue
  • Svelte
  • Solid
  • Preact
  • Angular
  • Cocos Creator
  • Vanilla JavaScript

What's here

  • Minimal TypeScript SDK (src/) that creates/destroys the modal with a simple API.
  • Themeable CSS (src/styles.css) with gradients, blur, and responsive layout.
  • Example scaffold (examples/basic) showing how to open the modal, plus a full-flow mock page (examples/full-flow) with CTA -> modal -> mock auth -> close,支持深色金色卡片风格。
  • Build setup via tsc (no runtime deps).

Quick Start

Installation

npm install @0xobelisk/controller

Basic Usage (Vanilla JS)

import { createAuthModal } from '@0xobelisk/controller';
import '@0xobelisk/controller/styles.css';

const modal = createAuthModal({
  onSelect: (providerId) => {
    console.log('Selected:', providerId);
    if (providerId === 'create-session') {
      // Handle session creation
      handleCreateSession();
    } else if (providerId === 'quit') {
      modal.close();
    }
  },
  onClose: () => {
    console.log('Modal closed');
  }
});

modal.open();

React / Next.js

import { useAuthModal } from '@0xobelisk/controller/react';
import '@0xobelisk/controller/styles.css';

export default function LoginPage() {
  const modal = useAuthModal({
    onSelect: (providerId) => {
      console.log('Selected:', providerId);
      if (providerId === 'create-session') {
        handleCreateSession();
      }
    }
  });

  return <button onClick={modal.open}>Login</button>;
}

See complete integration guides for all platforms →

Session Management

Session management with blockchain authentication:

import { runSessionFlow } from '@0xobelisk/controller';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';

const userKeypair = Ed25519Keypair.generate();

try {
  const session = await runSessionFlow({
    keypair: userKeypair,
    endpoints: {
      start: 'https://api.example.com/session/start',
      create: 'https://api.example.com/session/create'
    }
  });

  console.log('Session created:', session.sessionKey);
} catch (error) {
  console.error('Session creation failed:', error);
}

See complete session management guide →

Development

Run examples locally:

npm install
npm run build
npm run serve           # http://localhost:4173

Examples available at:

  • Basic demo: http://localhost:4173/examples/basic/
  • Full flow: http://localhost:4173/examples/full-flow/

Custom Styling

Card Variant with Background Image

const modal = createAuthModal({
  variant: 'card',
  accentColor: '#7a63ff',
  backgroundImage: 'https://unpkg.com/@0xobelisk/controller/dist/dubhe.jpeg',
  onSelect: (providerId) => {
    console.log('Selected:', providerId);
  }
});

Custom Theme Colors

const modal = createAuthModal({
  accentColor: '#6366f1', // Indigo
  onSelect: handleAuth
});

See complete styling guide →

Supported Platforms

Adapters available for all major platforms:

  • React / Next.js: @0xobelisk/controller/react
  • Vue 3: @0xobelisk/controller/vue
  • Svelte: @0xobelisk/controller/svelte
  • Solid: @0xobelisk/controller/solid
  • Preact: @0xobelisk/controller/preact
  • Angular: @0xobelisk/controller/angular
  • Cocos Creator: @0xobelisk/controller/cocos
  • Vanilla JS: Direct import from @0xobelisk/controller

View platform-specific integration guides →

Features

  • 🎨 Themeable: Customize colors, layouts, and styling
  • 🌐 Universal: Works in browser, mobile WebView, and game engines
  • 📦 Lightweight: Minimal dependencies, tree-shakeable
  • 🔐 Session Management: Built-in blockchain authentication flows
  • Fast: Optimized bundle size with code splitting
  • 🎯 TypeScript: Full type safety and IntelliSense

API Reference

createAuthModal(options)

Returns an AuthModalController instance.

Options:

  • onSelect: (providerId: string) => void - Required callback when button clicked
  • onClose?: () => void - Optional callback when modal closes
  • title?: string - Modal title (default: "Authenticate to continue")
  • subtitle?: string - Modal subtitle
  • variant?: 'card' | 'split' - Layout variant (default: "split")
  • accentColor?: string - Primary color (default: "#7a63ff")
  • backgroundImage?: string - Background image URL
  • buttons?: AuthButton[] - Custom buttons
  • container?: HTMLElement - Mount container (default: document.body)

Returns:

  • open() - Show the modal
  • close() - Hide the modal
  • destroy() - Remove and cleanup
  • isOpen() - Check if modal is open

See complete API reference →

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Obelisk Labs

Support