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

xlogin

v0.0.3

Published

Universal login widget for Nostr and Solid

Readme

xlogin

Universal login widget for Nostr and Solid. One script tag gives you a login button (bottom-right corner) with a tabbed modal supporting both identity systems.

Quick Start

CDN (recommended)

<script src="https://unpkg.com/xlogin"></script>

That's it. A purple Login button appears at the bottom-right of your page.

CDN with options

<script src="https://unpkg.com/xlogin"
  data-idp="https://solidcommunity.net"
  data-guest="<64-char-hex-privkey>">
</script>

npm

npm install xlogin
<script src="node_modules/xlogin/xlogin.js"></script>

How It Works

  1. User clicks the Login button
  2. A tabbed modal appears with Nostr and Solid tabs
  3. Nostr tab: browser extension, guest key, or paste a private key
  4. Solid tab: quick-select providers (solidcommunity.net, solidweb.me, solidweb.org, solid.social) or custom IDP
  5. After login, the button shows the user's identity
  6. Click the button again to logout

API

// Unified identity — works regardless of login method
window.xlogin.type   // "nostr" or "solid"
window.xlogin.id     // pubkey (nostr) or webId (solid)

// Unified authenticated fetch — works with both protocols
// Nostr: sends NIP-98 Authorization header
// Solid: sends DPoP Authorization header
const res = await window.xlogin.authFetch('https://example.com/api/data')

// Programmatic
window.xlogin.login()   // open modal
window.xlogin.logout()  // log out

Nostr (NIP-07 compatible)

After Nostr login, window.nostr is fully functional:

const pubkey = await window.nostr.getPublicKey()
const signed = await window.nostr.signEvent({ kind: 1, content: 'Hello', tags: [], created_at: Math.floor(Date.now() / 1000) })
const cipher = await window.nostr.nip04.encrypt(pubkey, 'secret')
const plain  = await window.nostr.nip04.decrypt(pubkey, cipher)

Solid

After Solid login, window.solid.session provides authenticated fetch:

window.solid.webId   // "https://alice.solidcommunity.net/profile/card#me"
const res = await window.solid.session.authFetch('https://alice.solidcommunity.net/private/data.ttl')

Events

document.addEventListener('xlogin', (e) => {
  console.log('Logged in:', e.detail.type, e.detail.id)
})

document.addEventListener('xlogout', () => {
  console.log('Logged out')
})

Full Example

<!DOCTYPE html>
<html>
<head><title>My App</title></head>
<body>
  <h1>My App</h1>
  <p id="status">Not logged in</p>

  <script>
    document.addEventListener('xlogin', (e) => {
      document.getElementById('status').textContent =
        'Logged in via ' + e.detail.type + ': ' + e.detail.id
    })
    document.addEventListener('xlogout', () => {
      document.getElementById('status').textContent = 'Not logged in'
    })
  </script>
  <script src="https://unpkg.com/xlogin"></script>
</body>
</html>

Configuration

| Attribute | Description | Example | | ------------- | ------------------------------------ | ---------------------------------------- | | data-idp | Default Solid identity provider URL | data-idp="https://solidcommunity.net" | | data-guest | Nostr guest private key (64 hex) | data-guest="abcd...1234" |

Built-in Solid Providers

Features

  • Zero build — single script, no bundler required
  • Two protocols — Nostr (NIP-07 + NIP-98) and Solid (OIDC + DPoP) in one widget
  • Unified authFetch — one API for authenticated requests, regardless of protocol
  • Shadow DOM — styles are fully encapsulated
  • Session persistence — Nostr via localStorage, Solid via IndexedDB
  • Auto restore — sessions survive page reloads
  • NIP-07 compatiblewindow.nostr works with any Nostr app
  • DPoP + PKCE — secure Solid authentication
  • Tabbed UI — clean separation between login methods

Dependencies

Loaded dynamically from CDN at runtime (zero install required):

License

AGPL-3.0-or-later — Copyright (C) 2026 Melvin Carvalho