Skip to content

Add audience segments and drip sequences to TypeScript SDK - #352

Merged
purpshell merged 4 commits into
mainfrom
feat/campaign-segments-drip
Oct 17, 2026
Merged

purpshell merged 4 commits into
mainfrom
feat/campaign-segments-drip

Conversation

@purpshell

@purpshell purpshell commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Add TypeScript audience segments and drip sequence support from merged API dev f46ebd5162453e812dafa76ce02b420ddabe6921 (segments #596, drip #597). Segment CRUD keeps observed revisions, both count previews, organization-only authority and frozen campaign snapshot reads. Both campaign APIs accept partial drip PATCH settings and expose enrollment, pause and per-step analytics.

Impact

Impact table

Area Status Evidence / dependency
SDKs TypeScript updated; native additions handed to active #348 New resources, exported types and focused source-hashed contract fixture; native handoff; branch pushed within 24 hours
CLI CLI #81, draft pending SDK prerelease Local matching types and unchanged registry pin
Docs and feature releases Source README/changelog updated; public package guidance held Monorepo #627 release records; registry versions and matching staging acceptance required
Customer Analytics Client projection updated CampaignDripStats and per-step counters; no server calculation change
Roadmap and session checkpoint Blocked on parent reconciliation Parent owns Linear/Notion access and sanitized transcript publication

No impact table

Area Specific reason Evidence
API, Admin API/controls/MCP Consume merged contracts; no route, authority or feature policy change API #596/#597; changed SDK files only
Libraries, runners/Bartender, Temporal No protocol, dispatch, workflow history or retry authority change Resource wrappers use existing transport
Inspector, Console UI, Admin Console UI No graphical UI changes Changed-file list
Onboarding, activation, consent/user tracking Existing credentials retained; no new collection or analytics events Existing Client/MessagingClient transport
Billing/upgrade/PAYG, Usage No new charge, meter, credit or entitlement Additive campaign inputs/read projections only
Logs and audit logs No producer, storage or retention change Existing API remains authority
Help Center and marketing No launch or availability claims No changed Help Center/marketing paths

Verification

At 12b85499e061dc556947ce422357e6d46db3f4e4, 11 Node 24 focused synthetic HTTP/type tests cover segment CRUD/preview paths, revisions, pagination, 403 feature_unavailable/permission_denied, 409 state_conflict propagation without mutation retries, partial PATCH omission on both surfaces, enrollment replay response and snapshot reads. Contract assertions cover PATCH absence of defaults, four-range step windows and segment bounds. Typecheck passes; seven release/coverage coordination tests pass; full suite at final head (1,533 tests), all workspace builds, coverage ledger, function and formatting checks pass; final-head Node 20 and 22 CI is green (run). No deployed API, real send, beta enrollment, clean registry install or publication exercised.

Session provenance and UI evidence

Parent T3 thread 646a0c0a-e900-4d0f-9a25-0b8834d7d4e6. OpenAI gpt-6.1-sol through T3 Code Codex harness. Common brief and project scope/writing guidance applied; sequential implementation, no delegated agents or requested reviews. Parent orchestrator owns the committed sanitized checkpoint and registration links, currently pending. No graphical UI changed; HTTP fixtures use synthetic data.

Rollout and rollback

Do not merge or publish in this task. Merge SDK source before publishing a prerelease accepted against the same API revision; then pin that exact version in the CLI, accept the CLI and publish held public instructions. Stable packages require production acceptance. Source support does not establish installed availability. Revert additive client changes before publication; after publication use a corrective package. No database rollback applies.

Open questions: exact package versions and environment acceptance remain release gates. No product choice remains open.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 38918362-52f3-40fb-b61d-e49d46cbb62a
📥 Commits

Reviewing files that changed from the base of the PR and between 55f75dc and 12b8549.

📒 Files selected for processing: 13
  • CHANGELOG.md
  • contracts/README.md
  • contracts/campaign-segments-drip.json
  • packages/typescript/README.md
  • packages/typescript/src/client.ts
  • packages/typescript/src/index.ts
  • packages/typescript/src/messaging/campaign-drip.ts
  • packages/typescript/src/messaging/campaigns.ts
  • packages/typescript/src/messaging/types.ts
  • packages/typescript/src/platform/audience-segments.ts
  • packages/typescript/src/platform/campaigns.ts
  • packages/typescript/src/platform/types.ts
  • packages/typescript/test/campaign-segments-drip.test.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

📝 Walkthrough

The TypeScript SDK adds organization-scoped audience-segment operations and exposes campaign drip settings, segment selection, sequence data, analytics, and contact enrollment through its campaign resources.

Changes: Audience Segments and Drip Campaigns

Layer / File(s) Summary
Audience segment resource
packages/typescript/src/platform/audience-segments.ts, packages/typescript/src/client.ts, packages/typescript/src/index.ts, packages/typescript/test/campaign-segments-drip.test.ts, packages/typescript/README.md
Adds audience-segment types and list, retrieve, create, update, delete, and preview methods. Organization clients expose the resource. Tests cover request shapes, conflicts, and client access; the README describes segment operations.
Drip and campaign contracts
packages/typescript/src/messaging/campaign-drip.ts, packages/typescript/src/messaging/types.ts, packages/typescript/src/platform/types.ts, packages/typescript/src/index.ts, packages/typescript/test/campaign-segments-drip.test.ts, packages/typescript/README.md, contracts/README.md, CHANGELOG.md
Adds drip settings, sequence, enrollment, snapshot, and analytics types. Campaign requests and responses include drip and segment data. Tests check contract constraints, launch conflicts, analytics, and recipient fields. Documentation records the API contract pin and SDK behavior.
Campaign enrollment methods
packages/typescript/src/messaging/campaigns.ts, packages/typescript/src/platform/campaigns.ts, packages/typescript/test/campaign-segments-drip.test.ts
Adds an enroll method to both campaign resources. Each posts to the campaign enrollment endpoint with automatic network retries disabled. Tests cover enrollment responses.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 12b85

No confirmed SDK defect blocks merge. Matching API acceptance and release checks remain outstanding before publication.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: adding audience segment and drip sequence support to the TypeScript SDK.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T09:40:24.674506Z 8686235 PR opened
🔒 Security Review ✅ Completed 2026-10-17T09:37:43.311126Z 8686235 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86862358b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/typescript/src/messaging/campaign-drip.ts
Comment thread packages/typescript/src/platform/campaigns.ts
Comment thread packages/typescript/src/platform/types.ts Outdated
Comment thread packages/typescript/src/platform/audience-segments.ts
@purpshell
purpshell merged commit 2b28e8a into main Oct 17, 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