Loading…
@bsv/auth provides framework-neutral, expiry-bound, single-use wallet
authentication proofs. It separates proof creation and verification from HTTP,
Express, and database choices.
Install the SDK peer dependency with the package:
npm install @bsv/auth @bsv/sdkAuthProofClient and createAuthProof create an action-bound proof with a
wallet.AuthProofServer and verifyAuthProof verify the signature, identity,
action, expiry, and nonce.checkAuthSigData, createAuthSigData, and serializeAuthSigData expose
the lower-level proof data contract.import { AuthProofClient, AuthProofServer } from '@bsv/auth'
const options = { protocol: [2, 'example auth'] as [2, string] }
const client = new AuthProofClient(options)
const server = new AuthProofServer(options)Client and server must use the same protocol. Production verification must
inject an atomic consumeNonce implementation. A process-local map is suitable
only for one process; replicated or restarting services need a shared store
with uniqueness and expiry.
The package publishes strict ESM and CommonJS entry points and supports Node.js 22 or newer. See the package README for a complete client/server example and store guidance.
Open BSV License Version 6. See the package license.