Skip to content

Version Packages#12

Merged
jwahdatehagh merged 1 commit intomainfrom
changeset-release/main
Mar 24, 2026
Merged

Version Packages#12
jwahdatehagh merged 1 commit intomainfrom
changeset-release/main

Conversation

@jwahdatehagh
Copy link
Copy Markdown
Member

@jwahdatehagh jwahdatehagh commented Mar 24, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@signinwithethereum/siwe@4.1.0

Minor Changes

  • f537bdb Thanks @jwahdatehagh! - Harden and unify error handling across the library

    SiweError now extends Error — Provides stack traces, works with instanceof Error, and integrates with error reporting tools (Sentry, etc.). The type, expected, and received fields are now readonly.

    SiweError.type narrowed from SiweErrorType | string to SiweErrorType — Enables exhaustive switch/case on error types without a default fallback.

    SiweResponse.error narrowed from SiweError | Error to SiweError — No more type narrowing needed when handling verification results.

    verify() now throws SiweError directly when suppressExceptions is false (the default). Previously it threw the entire SiweResponse object. Update catch blocks:

    // Before (v4.0):
    try {
      await msg.verify(params)
    } catch (e) {
      console.log(e.error.type)
    } // e was SiweResponse
    
    // After (v4.1):
    try {
      await msg.verify(params)
    } catch (e) {
      if (e instanceof SiweError) {
        console.log(e.type) // e is SiweError directly
      }
    }

    All error paths now throw SiweError — Configuration errors (createConfig, createEthersConfig, createViemConfig), nonce generation, invalid verify params, and message preparation failures all throw typed SiweError instances instead of bare Error.

    New SiweErrorType entries:

    • MISSING_CONFIG — no verification config found
    • MISSING_PROVIDER_LIBRARY — required provider library (viem/ethers) not installed
    • NONCE_GENERATION_FAILED — nonce creation failed
    • INVALID_PARAMS — invalid keys passed to verify()
    • MALFORMED_MESSAGE — message could not be prepared for signing

    SiweParseError — New structured error class in @signinwithethereum/siwe-parser (and re-exported from @signinwithethereum/siwe) for parse failures, with an errors: string[] field containing individual validation errors.

Patch Changes

  • 60ada57 Thanks @jwahdatehagh! - Cleanup: Lazy imports, improve error messages and logs

  • Updated dependencies [f537bdb]:

    • @signinwithethereum/siwe-parser@4.1.0

@signinwithethereum/siwe-parser@4.1.0

Minor Changes

  • f537bdb Thanks @jwahdatehagh! - Harden and unify error handling across the library

    SiweError now extends Error — Provides stack traces, works with instanceof Error, and integrates with error reporting tools (Sentry, etc.). The type, expected, and received fields are now readonly.

    SiweError.type narrowed from SiweErrorType | string to SiweErrorType — Enables exhaustive switch/case on error types without a default fallback.

    SiweResponse.error narrowed from SiweError | Error to SiweError — No more type narrowing needed when handling verification results.

    verify() now throws SiweError directly when suppressExceptions is false (the default). Previously it threw the entire SiweResponse object. Update catch blocks:

    // Before (v4.0):
    try {
      await msg.verify(params)
    } catch (e) {
      console.log(e.error.type)
    } // e was SiweResponse
    
    // After (v4.1):
    try {
      await msg.verify(params)
    } catch (e) {
      if (e instanceof SiweError) {
        console.log(e.type) // e is SiweError directly
      }
    }

    All error paths now throw SiweError — Configuration errors (createConfig, createEthersConfig, createViemConfig), nonce generation, invalid verify params, and message preparation failures all throw typed SiweError instances instead of bare Error.

    New SiweErrorType entries:

    • MISSING_CONFIG — no verification config found
    • MISSING_PROVIDER_LIBRARY — required provider library (viem/ethers) not installed
    • NONCE_GENERATION_FAILED — nonce creation failed
    • INVALID_PARAMS — invalid keys passed to verify()
    • MALFORMED_MESSAGE — message could not be prepared for signing

    SiweParseError — New structured error class in @signinwithethereum/siwe-parser (and re-exported from @signinwithethereum/siwe) for parse failures, with an errors: string[] field containing individual validation errors.

@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 8e130b3 to ac9c9f1 Compare March 24, 2026 08:16
@github-actions github-actions bot force-pushed the changeset-release/main branch from ac9c9f1 to 49985eb Compare March 24, 2026 08:16
@jwahdatehagh jwahdatehagh reopened this Mar 24, 2026
@jwahdatehagh jwahdatehagh merged commit c866e16 into main Mar 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant