Skip to content

Conversation

@fan-zhang-sv
Copy link
Contributor

@fan-zhang-sv fan-zhang-sv commented Sep 4, 2025

Summary

🚀 Release v3.9.8 - Commerce Correlation ID and Mobile Relay Enhancements

This release introduces commerce correlation ID tracking and mobile relay improvements to enhance analytics and user experience for Payment Link integrations.

📋 Changes Summary

🔧 Core Features:

  • Commerce Correlation ID Support: Added ability to set and track commerce correlation IDs across SDK operations
  • Mobile Relay Enhancements: Improved mobile wallet deep linking with additional query parameters
  • Enhanced Telemetry: Added commerce correlation ID tracking to all provider request events

📦 Version Bump:

  • Updated SDK version from 3.9.73.9.8

🛠 Technical Changes

New Commerce Correlation ID Module

  • File: src/telemetry/commerceCorrelationId.ts
  • Added setCommerceCorrelationId() and getCommerceCorrelationId() functions
  • Exported setCommerceCorrelationId from main SDK index for public API

Enhanced QR Code URL Generation

  • File: src/core/util.ts
  • Added isMobileRelay parameter to createQrUrl() function
  • Added support for:
    • pl: 't' - Payment Link custom build flag
    • m: 't' - Mobile relay flag (when applicable)
    • cid: <correlationId> - Commerce correlation ID (when available)

Provider Request Tracking

  • File: src/provider/CoinbaseWalletProvider.ts
  • Enhanced all provider request events (logRequestStarted, logRequestCompleted, logRequestError) with commerce correlation ID tracking

Mobile Relay Improvements

  • File: src/relay/mobile/MobileRelay.ts
  • Added deep linking analytics for mobile wallet connection attempts
  • Enhanced QR code URL generation with mobile-specific parameters
  • Added logMobileWalletLinkRequestAccountsDeeplinked telemetry event

Telemetry Events Updates

  • Files: src/telemetry/events/provider.ts, src/telemetry/events/walletlink.ts
  • Added commerceCorrelationId parameter to all provider request events
  • New mobile deep linking telemetry event

Architecture Improvements

  • File: src/relay/walletlink/WalletLinkRelay.ts
  • Changed private properties to protected to enable proper inheritance in MobileRelay

🎯 Use Cases

This release specifically targets:

  • Payment Link Integration: Enhanced tracking and analytics for commerce transactions
  • Mobile Wallet Experience: Improved deep linking and connection flow for mobile users
  • Analytics & Debugging: Better correlation tracking across SDK operations

✅ Testing Considerations

  • Verify commerce correlation ID is properly passed through all request flows
  • Test mobile deep linking with new query parameters
  • Confirm telemetry events include correlation ID when available
  • Validate backward compatibility for existing integrations

🔗 Files Changed

  • packages/wallet-sdk/package.json - Version bump
  • packages/wallet-sdk/src/version.ts - Version constant update
  • packages/wallet-sdk/src/index.ts - Export new public API
  • packages/wallet-sdk/src/core/util.ts - QR URL enhancements
  • packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts - Request tracking
  • packages/wallet-sdk/src/relay/mobile/MobileRelay.ts - Mobile improvements
  • packages/wallet-sdk/src/relay/walletlink/WalletLinkRelay.ts - Architecture updates
  • packages/wallet-sdk/src/telemetry/commerceCorrelationId.ts - New file
  • packages/wallet-sdk/src/telemetry/events/provider.ts - Enhanced events
  • packages/wallet-sdk/src/telemetry/events/walletlink.ts - New mobile event

How did you test your changes?

Copy link
Contributor

@eric-ships eric-ships left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How were these changes tested?

export { CoinbaseWalletProvider } from './provider/CoinbaseWalletProvider';
export default CoinbaseWalletSDK;

export { setCommerceCorrelationId } from './telemetry/commerceCorrelationId';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being used here?

Copy link
Contributor

@eric-ships eric-ships left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding unit tests?

@arjun-dureja
Copy link
Contributor

Noticed typecheck and tests are failing, can we fix before adding to the paymentlink app?

Copy link
Contributor

@spencerstock spencerstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FlinnBella
Copy link

Perhaps we should pause on this. It appears half of the test are failing! Jeez.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants