Skip to content

Add custom tracking domain support to the Node.js SDK - #758

Merged
quzhi1 merged 1 commit into
mainfrom
codex/EN-142-custom-tracking-domain
Jul 30, 2026
Merged

Add custom tracking domain support to the Node.js SDK#758
quzhi1 merged 1 commit into
mainfrom
codex/EN-142-custom-tracking-domain

Conversation

@quzhi1

@quzhi1 quzhi1 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional trackingOptions.domainName to the shared send and draft tracking-options request type.
  • Verify wire serialization emits tracking_options.domain_name exactly once and preserves existing payloads when the field is omitted.
  • Add regular Send, Transactional Send, draft, and scheduled-send examples, including the distinction between a Transactional sender domain and tracking hostname.
  • Add an Unreleased changelog entry.

Why

The shared SendMessageRequest and TrackingOptions types cover regular sends, Transactional Send, draft create/update, and scheduled sends. Adding the optional property to that shared type lets developers select a tracking hostname without type escape hatches or operation-specific serializers.

Developer impact

Developers can supply an active organization-owned custom hostname as trackingOptions.domainName. The SDK serializes it as tracking_options.domain_name. Existing requests are unchanged when the optional property is omitted.

For Transactional Send, the top-level domainName remains the verified sender domain in /v3/domains/{domainName}/messages/send; requestBody.trackingOptions.domainName is the separate tracking hostname used in recipient-visible links and open pixels.

Validation

  • npm test -- --runInBand — 30 suites, 484 tests passed
  • npm run lint
  • npm run lint:prettier:check
  • npm run build
  • Strict TypeScript check of examples/messages/messages.ts against the built package
  • git diff --check

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (cd785ad) to head (52b30cd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #758   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files          43       43           
  Lines        1041     1041           
  Branches       90       90           
=======================================
  Hits         1028     1028           
  Misses         12       12           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quzhi1
quzhi1 merged commit 2bdf4ae into main Jul 30, 2026
11 checks passed
@quzhi1
quzhi1 deleted the codex/EN-142-custom-tracking-domain branch July 30, 2026 21:02
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.

2 participants