Skip to content

Conversation

@ftheirs
Copy link
Contributor

@ftheirs ftheirs commented Dec 3, 2025

Backend and SDK modifications to support CAIP-122 (SIWX)
Update demo-app to allow the user to use either SIWE or SIWX authentication

⚠️ Breaking Changes ⚠️

  • Short description

    Domain extraction is now automatic from URIs, and session providers are optional when creating MspClient instances.

  • Who is affected

    • Backend API consumers calling /auth/nonce or /auth/message that previously provided a domain field
    • SDK users calling MspClient.auth.SIWE() or MspClient.auth.SIWX() with a domain parameter
    • SDK users creating MspClient instances with a required sessionProvider parameter
  • Suggested code changes

    Backend API: Remove domain field from NonceRequest payloads. The backend extracts the domain from the uri field.

SDK - SIWE/SIWX: Remove the domain parameter

  // Before
  await mspClient.auth.SIWE(walletClient, "localhost:3000", "http://localhost:3000");
  

  // After
  await mspClient.auth.SIWE(walletClient, "http://localhost:3000");

SDK - MspClient: sessionProvider is now optional. You can set it after authentication:

  // Before
  const client = await MspClient.connect(config, sessionProvider);
 

  // After
  const client = await MspClient.connect(config);
  // ... authenticate ...
  client.setSessionProvider(async () => session);

@ftheirs ftheirs added B3-backendnoteworthy Changes should be mentioned in SH backend related release notes breaking Needs to be mentioned in breaking changes D2-noauditneeded🙈 PR doesn't need to be audited B1-sdknoteworthy Changes should be mentioned in SH SDK related release notes labels Dec 3, 2025
@ftheirs ftheirs force-pushed the feat/siwx branch 2 times, most recently from e33a1a9 to e88fc2c Compare December 3, 2025 13:59
@ftheirs ftheirs marked this pull request as ready for review December 3, 2025 14:16
@ftheirs ftheirs requested a review from TDemeco December 3, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B1-sdknoteworthy Changes should be mentioned in SH SDK related release notes B3-backendnoteworthy Changes should be mentioned in SH backend related release notes breaking Needs to be mentioned in breaking changes D2-noauditneeded🙈 PR doesn't need to be audited

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants