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

@valve-tech/siwe-store

v0.19.0

Published

Server-side state for SIWE (Sign-In with Ethereum) that viem/siwe deliberately leaves to the app: a single-use, TTL'd nonce store (atomic consume, delete-before-TTL-check so a race-loser cannot reuse) and an opaque CSPRNG session store bound to an address

Readme

@valve-tech/siwe-store

The server-side state for Sign-In with Ethereum that viem/siwe deliberately leaves to the app: a single-use, TTL'd nonce store (the replay defense) and an opaque session store (the "still logged in" state).

viem/siwe owns the crypto, the EIP-4361 message, and validation. This package owns the two stateful pieces it can't: atomic nonce consumption and session issuance.

Install

npm install @valve-tech/siwe-store viem

Use

import { createMemoryNonceStore, createMemorySessionStore } from '@valve-tech/siwe-store'
import { createSiweMessage, parseSiweMessage, validateSiweMessage } from 'viem/siwe'
import { recoverMessageAddress, isAddressEqual } from 'viem'

const nonces = createMemoryNonceStore()
const sessions = createMemorySessionStore()

// GET /auth/challenge
const message = createSiweMessage({
  address, chainId, domain, uri, version: '1', nonce: nonces.issue(), statement,
})

// POST /auth/verify  { message, signature }
const fields = parseSiweMessage(message)
if (!fields.nonce || !nonces.consume(fields.nonce)) throw new Error('replay')
// Re-assert binding fields validateSiweMessage does NOT check (uri, chainId, version):
if (fields.version !== '1' || fields.uri !== uri || fields.chainId !== chainId) throw new Error('bad message')
if (!validateSiweMessage({ message: fields, domain })) throw new Error('bad domain/time')
const recovered = await recoverMessageAddress({ message, signature }) // EOA-only
if (!fields.address || !isAddressEqual(recovered, fields.address)) throw new Error('bad sig')
const token = sessions.issue(fields.address)

To also accept EIP-1271 / EIP-6492 smart-contract accounts, replace the recoverMessageAddress step with a viem PublicClient: await publicClient.verifyMessage({ address: fields.address, message, signature }) (boolean; handles EOA + 1271 + 6492). siwe-store is signature-scheme-agnostic, so the choice is yours.

Interfaces vs. adapters

This package ships the NonceStore / SessionStore interfaces (the contract for Redis/SQL/cookie backends) plus in-memory defaults. The in-memory stores are single-instance and reset on restart — for multi-instance production state, implement the interfaces over Redis, or reach for iron-session / NextAuth. This package intentionally ships no such adapter.

Part of the toolkit

@valve-tech/siwe-store ships on the valve-tech/evm-toolkit synchronized release line. Pairs with viem/siwe (crypto/message/ validation) and, on the client, @valve-tech/wallet-key-session.