{"_id":"@signinwithethereum/siwe","_rev":"10-e9702c6af97d7a864c9442f2752d46c2","name":"@signinwithethereum/siwe","dist-tags":{"latest":"4.2.1"},"versions":{"4.0.0":{"name":"@signinwithethereum/siwe","version":"4.0.0","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.0.0","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"92972dcf24f98c91fdd5dae66220b6ecdddce4e3","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.0.0.tgz","fileCount":14,"integrity":"sha512-Mkqohp072PRchvC+N7JGxiWPTaqouXFy2nXKp6JdZitG0nmHL+xAzgFMMpPH+mkQrI8TIy/4r3ex0sUVT4CAAw==","signatures":[{"sig":"MEUCIQD9N1S+3wGKXoKu+CqJ4Do+YRweclnRy3QY2iQEnlTgPwIgUvqyDkGcjUBamlTtDOPBprXTrg68irQ6eRXOwIHEyvk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54975},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.0.0.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/b41e6b4383983dc511b192478e6e9898/signinwithethereum-siwe-4.0.0.tgz","_integrity":"sha512-Mkqohp072PRchvC+N7JGxiWPTaqouXFy2nXKp6JdZitG0nmHL+xAzgFMMpPH+mkQrI8TIy/4r3ex0sUVT4CAAw==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.0.0_1774284370163_0.10196740659835513","host":"s3://npm-registry-packages-npm-production"}},"4.0.1":{"name":"@signinwithethereum/siwe","version":"4.0.1","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.0.1","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"6ebd38da9cd971e229be0d220cb9736fec4b448d","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.0.1.tgz","fileCount":14,"integrity":"sha512-JOPVwvlclfMhN/XqTcoy9rKXWMkf5RMi/qLgcBJTRUiaceCLirgLht2ieowK4MvGf0Zv0iqnMGplcei8fRGy9Q==","signatures":[{"sig":"MEUCIC8FInfje+MTh7+ue5QVXruP8AMGGyTGltnCJXP6T5o/AiEAtGlxKricF8HGayHpFuqbwuJnx5JboBluHpQ7KnC6UCM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57301},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.0.1.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/9e3953c5a433b56c3f28cd104c9e9aee/signinwithethereum-siwe-4.0.1.tgz","_integrity":"sha512-JOPVwvlclfMhN/XqTcoy9rKXWMkf5RMi/qLgcBJTRUiaceCLirgLht2ieowK4MvGf0Zv0iqnMGplcei8fRGy9Q==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.0.1_1774290500204_0.13907660524005006","host":"s3://npm-registry-packages-npm-production"}},"4.0.2":{"name":"@signinwithethereum/siwe","version":"4.0.2","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.0.2","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"7de5acb39b879d2f17f7ef1a5e99882ba66610dd","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.0.2.tgz","fileCount":14,"integrity":"sha512-Z4IBsisFFH0yjjgur80a40kgivk3luX5+KBwbAblksyf1FSQLmIm8PB9Yqqgm74bd4H/nFeYZvmV2H0Ofn92rQ==","signatures":[{"sig":"MEQCIFx252d7fluhHx/Wp0GRBGtLD6N1tzft9TylIHZyw+fWAiAI1x9GtQgn1oXr1eu7WUMCTISasConSCOyxYSpvS/fBA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57940},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.0.2.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/8335dd8cc45c9bcb847eb7a61d58446b/signinwithethereum-siwe-4.0.2.tgz","_integrity":"sha512-Z4IBsisFFH0yjjgur80a40kgivk3luX5+KBwbAblksyf1FSQLmIm8PB9Yqqgm74bd4H/nFeYZvmV2H0Ofn92rQ==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.0.2_1774337161790_0.992685338800017","host":"s3://npm-registry-packages-npm-production"}},"4.0.3":{"name":"@signinwithethereum/siwe","version":"4.0.3","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.0.3","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"29f73573902ec4cc6e1d4ed382ca23e6bd8f023a","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.0.3.tgz","fileCount":14,"integrity":"sha512-d5IxaJ9JDYKVqzthhXK0XdyT0qAAPTMFaQNDSdHBYkoD4fEFqz6/kcRntgeiYurD4c077Xqr5Ypz/PLScTeQpQ==","signatures":[{"sig":"MEQCICEc0Boa7DFt1ovVptd8pnM1QwjuPcjYDjCwpyWhom8zAiARV2XRXK4R+jspDqHUewhDOBII40CnKgEAzaOVwKW1oA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57940},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.0.3.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/7345292611430dc83c4819507c851be5/signinwithethereum-siwe-4.0.3.tgz","_integrity":"sha512-d5IxaJ9JDYKVqzthhXK0XdyT0qAAPTMFaQNDSdHBYkoD4fEFqz6/kcRntgeiYurD4c077Xqr5Ypz/PLScTeQpQ==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.0.2"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.0.3_1774337960511_0.5199136263837945","host":"s3://npm-registry-packages-npm-production"}},"4.1.0":{"name":"@signinwithethereum/siwe","version":"4.1.0","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.1.0","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"bd5e3cd04389254a5cd879416d4720d43753d1a3","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.1.0.tgz","fileCount":14,"integrity":"sha512-NT56M82i+A2uBU++F9PSBvEYPcjUV3BdClRVojWt3cbe7WizIVH1wi2qKJJR570RLHZvr8q1gUf0E90WymlMeA==","signatures":[{"sig":"MEYCIQCoYjUbrtPeGD7cYZK+B42TArhJrIDqNIs4LcjBxMnORQIhAOeAx+JC8KI8ksICw5s6ayVnMPDXpI+r0J6hxagd2zWT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60916},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.1.0.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/67ebd88e1a63911ee151a68c8baec678/signinwithethereum-siwe-4.1.0.tgz","_integrity":"sha512-NT56M82i+A2uBU++F9PSBvEYPcjUV3BdClRVojWt3cbe7WizIVH1wi2qKJJR570RLHZvr8q1gUf0E90WymlMeA==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.1.0"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.1.0_1774340296274_0.3572975781517762","host":"s3://npm-registry-packages-npm-production"}},"4.2.0":{"name":"@signinwithethereum/siwe","version":"4.2.0","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.2.0","maintainers":[{"name":"brantlyefp","email":"brantly@ethfollow.xyz"},{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"31b8fd14eb185859ab7bea9a491ea135b9d4f1c8","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.2.0.tgz","fileCount":14,"integrity":"sha512-6W+oyKgMFUZRJI4o9P9mTMzrokkXfu3tq1/CfOJj9QrMqyPqujJqv1xnxUAqDQwWVyCA8TMg0Fxk/+gXrDg2Nw==","signatures":[{"sig":"MEUCIQCDb5iAxT1xIfoI/Eu1MBNndwR9d3xUAiOjaLKFFRINhAIgF+ERi8BHFrVKSeMDWbLRLRIg70tuVmxVqIoBZkDkFjo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61982},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.2.0.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.ts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/d152c1eaa4142318954c475a0fa5507a/signinwithethereum-siwe-4.2.0.tgz","_integrity":"sha512-6W+oyKgMFUZRJI4o9P9mTMzrokkXfu3tq1/CfOJj9QrMqyPqujJqv1xnxUAqDQwWVyCA8TMg0Fxk/+gXrDg2Nw==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.11.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"@signinwithethereum/siwe-parser":"^4.2.0"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.2.0_1776093175645_0.4935711959688023","host":"s3://npm-registry-packages-npm-production"}},"4.2.1":{"name":"@signinwithethereum/siwe","version":"4.2.1","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe@4.2.1","maintainers":[{"name":"brantlyefp","email":"brantly@ethfollow.xyz"},{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"5f669d136911812cd84af425e917265bbb63d45a","tarball":"https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.2.1.tgz","fileCount":16,"integrity":"sha512-CQEQhCIgN9blil1YpaGR+wvGPdsBVK6zed5DBu03s1IdbSO3kA/n7Zp+SAkZGiHy3HY6OJm1Su0/Bd33vKK6nQ==","signatures":[{"sig":"MEUCIHA0peLCknrxAYadanJNn1Dk4xHYsixAVuU6BEjF22qjAiEA9DwZpofzKEjIdiVqd5htTZuxSI3xmgQE84MJo59Rj6Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":93348},"main":"dist/siwe.cjs","type":"module","_from":"file:signinwithethereum-siwe-4.2.1.tgz","types":"dist/siwe.d.ts","module":"dist/siwe.mjs","exports":{".":{"import":{"types":"./dist/siwe.d.mts","default":"./dist/siwe.mjs"},"require":{"types":"./dist/siwe.d.cts","default":"./dist/siwe.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/ea70c5b45fa3fc14ee0495f4c5d19bf7/signinwithethereum-siwe-4.2.1.tgz","_integrity":"sha512-CQEQhCIgN9blil1YpaGR+wvGPdsBVK6zed5DBu03s1IdbSO3kA/n7Zp+SAkZGiHy3HY6OJm1Su0/Bd33vKK6nQ==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.17.0","description":"Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.19.0","dependencies":{"@signinwithethereum/siwe-parser":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.7.0","ethers5":"npm:ethers@^5.7.0","ethers6":"npm:ethers@^6.13.0"},"peerDependencies":{"viem":"^2.7.0","ethers":"^5.7.0 || ^6.13.0"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/siwe_4.2.1_1788281425628_0.33113637112979255","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-03-23T16:46:10.093Z","modified":"2026-09-01T16:55:39.567Z","4.0.0":"2026-03-23T16:46:10.326Z","4.0.1":"2026-03-23T18:28:20.360Z","4.0.2":"2026-03-24T07:26:01.974Z","4.0.3":"2026-03-24T07:39:20.659Z","4.1.0":"2026-03-24T08:18:16.423Z","4.2.0":"2026-04-13T15:12:55.788Z","4.2.1":"2026-09-01T16:50:25.773Z"},"bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","homepage":"https://github.com/signinwithethereum/siwe","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe"],"repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"description":"Sign in with Ethereum (SIWE)","maintainers":[{"email":"jalil@1001.digital","name":"jwahdatehagh"},{"email":"aaron@1sat.io","name":"caveman_onchain"}],"readme":"# @signinwithethereum/siwe\n\nTypeScript implementation of [Sign in with Ethereum](https://eips.ethereum.org/EIPS/eip-4361) (EIP-4361). Create, parse, and verify SIWE messages with support for EOA, ERC-1271 (smart contract wallets), and EIP-6492 (pre-deployed wallets).\n\nWorks with **viem** or **ethers** (v5/v6).\n\n## Why this package?\n\nSmart account verification is tricky to get right. This package handles ERC-1271 (smart contract wallets) and EIP-6492 (pre-deployed wallets) automatically alongside standard EOA recovery, so `verify()` works for every type of Ethereum account without extra code: EOAs, multisigs, and smart wallets.\n\n## Install\n\n```bash\nnpm install @signinwithethereum/siwe\n```\n\nInstall a peer dependency (at least one required):\n\n```bash\nnpm install viem    # recommended\n# or\nnpm install ethers  # v5 or v6\n```\n\n## Quick Start\n\n```ts\nimport { SiweMessage, configure, createConfig } from '@signinwithethereum/siwe'\n\n// One-time setup — auto-detects viem or ethers\nconfigure(await createConfig('https://eth.llamarpc.com'))\n\n// Create a message\nconst message = new SiweMessage({\n  domain: 'example.com',\n  address: '0x...',\n  statement: 'Sign in to Example',\n  uri: 'https://example.com',\n  version: '1',\n  chainId: 1,\n  nonce: 'abc12345defg78901',\n  issuedAt: new Date().toISOString(),\n})\n\n// Get the EIP-4361 string to sign\nconst messageString = message.prepareMessage()\n\n// Verify a signature (after signing on the client)\nconst { success, data, error } = await message.verify(\n  { signature, domain: 'example.com', nonce: message.nonce },\n  { suppressExceptions: true },\n)\n```\n\n## Configuration\n\nYou must configure a verification backend before calling `verify()`. There are three approaches:\n\n### `createConfig(rpcUrl)` — auto-detect\n\nDetects whether viem or ethers is installed and creates the appropriate config with full EIP-1271 support.\n\n```ts\nimport { configure, createConfig } from '@signinwithethereum/siwe'\n\nconfigure(await createConfig('https://eth.llamarpc.com'))\n```\n\n### `createViemConfig(opts)` — viem\n\n```ts\nimport { configure, createViemConfig } from '@signinwithethereum/siwe'\nimport { createPublicClient, http } from 'viem'\nimport { mainnet } from 'viem/chains'\n\nconst publicClient = createPublicClient({ chain: mainnet, transport: http() })\nconfigure(await createViemConfig({ publicClient }))\n```\n\n### `createEthersConfig(provider)` — ethers\n\n```ts\nimport { configure, createEthersConfig } from '@signinwithethereum/siwe'\nimport { ethers } from 'ethers'\n\nconst provider = new ethers.JsonRpcProvider('https://eth.llamarpc.com')\nconfigure(createEthersConfig(provider))\n```\n\n### Per-call config\n\nInstead of setting a global config, you can pass `config` in verify options:\n\n```ts\nconst config = await createViemConfig({ publicClient })\nawait message.verify({ signature, domain, nonce }, { config })\n```\n\n## API\n\n### `SiweMessage`\n\nCreate from an object or parse from an EIP-4361 string:\n\n```ts\n// From object\nconst msg = new SiweMessage({ domain, address, uri, version, chainId, nonce, issuedAt })\n\n// From EIP-4361 string\nconst msg = new SiweMessage(rawMessageString)\n```\n\n**Fields:** `domain`, `address`, `uri`, `version`, `chainId`, `nonce`, `issuedAt` (required) and `scheme`, `statement`, `expirationTime`, `notBefore`, `requestId`, `resources` (optional).\n\n#### `prepareMessage(): string`\n\nReturns the EIP-4361 formatted message string, ready for EIP-191 signing.\n\n#### `verify(params, opts?): Promise<SiweResponse>`\n\nVerifies a signed message. Returns `{ success, data, error }`.\n\n**`params` (VerifyParams):**\n\n| Field | Required | Description |\n|---|---|---|\n| `signature` | yes | The wallet signature |\n| `domain` | yes | Expected domain (origin binding) |\n| `nonce` | yes | Expected nonce (replay protection) |\n| `scheme` | no | Expected URI scheme |\n| `uri` | no | Expected URI (required in strict mode) |\n| `chainId` | no | Expected chain ID (required in strict mode) |\n| `requestId` | no | Expected request ID |\n| `time` | no | ISO 8601 time to check against (defaults to now) |\n\n**`opts` (VerifyOpts):**\n\n| Field | Description |\n|---|---|\n| `config` | Per-call `SiweConfig` (overrides global) |\n| `suppressExceptions` | Return errors in response instead of throwing (default: `false`) |\n| `strict` | Require `uri` and `chainId` in params |\n| `verificationFallback` | Custom verification function run alongside EIP-1271 |\n\n### `generateNonce(): string`\n\nReturns a cryptographically secure random nonce (96 bits of entropy, alphanumeric).\n\n```ts\nimport { generateNonce } from '@signinwithethereum/siwe'\n\nconst nonce = generateNonce()\n```\n\n### `SiweConfig`\n\nInterface for bringing your own verification backend:\n\n```ts\ninterface SiweConfig {\n  verifyMessage: (message: string, signature: string) => string | Promise<string>\n  hashMessage: (message: string) => string\n  getAddress: (address: string) => string\n  checkContractWalletSignature?: (\n    address: string, message: string, signature: string, chainId: number,\n  ) => Promise<boolean>\n}\n```\n\n### EIP-6492 Utilities\n\n```ts\nimport { isEIP6492Signature, EIP6492_MAGIC_SUFFIX } from '@signinwithethereum/siwe'\n\nif (isEIP6492Signature(sig)) {\n  // Signature is from a pre-deployed smart contract wallet\n}\n```\n\n### Error Handling\n\n`SiweError` includes `type`, `expected`, and `received` fields. Error types are defined in the `SiweErrorType` enum covering domain/nonce/signature mismatches, expiration, and parsing failures.\n\n## Related\n\nThe ABNF parser is available as a standalone package at [`@signinwithethereum/siwe-parser`](https://www.npmjs.com/package/@signinwithethereum/siwe-parser) for projects that only need message parsing without verification.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}