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

@1001-digital/adonis-siwe

v0.1.0

Published

Lazy Sign-In with Ethereum sessions for AdonisJS

Readme

@1001-digital/adonis-siwe

Lazy Sign-In with Ethereum sessions for AdonisJS.

The package handles SIWE message creation, nonce storage, signature verification, and a short-lived wallet session stored in the Adonis session. EIP-4361 parsing and verification are delegated to @signinwithethereum/siwe. It deliberately does not create users or issue app tokens. Applications can use hooks when they want to link wallets to users or return custom data after verification.

Install

Requires Node.js 24 or newer, matching AdonisJS 7.

npm install @1001-digital/adonis-siwe
node ace configure @1001-digital/adonis-siwe

The configure hook creates config/siwe.ts, registers the provider, and adds basic environment variables.

Routes

By default the provider registers:

POST /auth/siwe/message
POST /auth/siwe/verify
GET  /auth/siwe/session
POST /auth/siwe/logout

The package expects @adonisjs/session middleware to be enabled.

Lazy auth

Do not call SIWE during normal wallet connect. Call it only when a user starts an action that needs server-trusted wallet ownership.

const { message } = await api.post('/auth/siwe/message', {
  address,
  chainId: 1,
})

const signature = await signMessage({ message })
await api.post('/auth/siwe/verify', { message, signature })

After verification, protected controllers can read the wallet session through the service:

import siwe from '@1001-digital/adonis-siwe/services/main'

const wallet = await siwe.requireSession(ctx)

Config

import env from '#start/env'
import { defineConfig } from '@1001-digital/adonis-siwe'

export default defineConfig({
  routes: {
    enabled: true,
    prefix: '/auth/siwe',
  },
  message: {
    domain: env.get('SIWE_DOMAIN'),
    uri: env.get('SIWE_URI'),
    statement: 'Sign in to EVM.NOW',
    chainId: 1,
  },
  verification: {
    allowedChainIds: [1],
    rpcUrls: {
      1: env.get('SIWE_RPC_URL'),
    },
  },
})

When an RPC URL is configured and contract wallets are enabled, verification uses @signinwithethereum/siwe's createConfig(rpcUrl) path, which supports EOA, ERC-1271 smart contract wallets, and EIP-6492 pre-deployed wallets through viem or ethers. Without an RPC URL, the package uses the same SIWE verifier with a local viem adapter for EOA signatures.

Hooks

export default defineConfig({
  hooks: {
    async onVerified(ctx, wallet) {
      // Link wallet to a user, issue an app token, refresh profile data, etc.
      return { linked: true }
    },
    async serializeSession(ctx, wallet) {
      return {
        address: wallet.address,
        chainId: wallet.chainId,
        authenticatedAt: wallet.authenticatedAt,
        expiresAt: wallet.expiresAt,
      }
    },
  },
})

onVerified data is returned from POST /auth/siwe/verify as data.