STRATCONN-6832 - [MNTN] - New audience destination#3809
STRATCONN-6832 - [MNTN] - New audience destination#3809joe-ayoub-segment wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new cloud-mode Audience Destination for MNTN Audiences to support Segment Engage audience syncing (adds/removes), including destination-level audience creation/lookup and unit tests.
Changes:
- Introduces the
mntn-audiencesdestination definition with custom auth, request extension, and audience lifecycle methods (testAuthentication,createAudience,getAudience). - Implements the
syncAudienceaction with identity construction (email/phone normalization + hashing), add/remove routing, and batch support viaMultiStatusResponse. - Adds unit tests covering destination audience lifecycle and sync behavior (single + batch, normalization, duplicate detection).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/destination-actions/src/destinations/mntn-audiences/index.ts | Defines the MNTN Audiences destination, auth fields, request headers, audience config, and actions. |
| packages/destination-actions/src/destinations/mntn-audiences/constants.ts | Adds the MNTN API base URL constant (and a good place to centralize API versioning). |
| packages/destination-actions/src/destinations/mntn-audiences/functions.ts | Implements testAuthentication, createAudience, and getAudience helpers. |
| packages/destination-actions/src/destinations/mntn-audiences/types.ts | Adds destination-level helper input/response TypeScript types. |
| packages/destination-actions/src/destinations/mntn-audiences/generated-types.ts | Generated Settings/AudienceSettings types for the destination. |
| packages/destination-actions/src/destinations/mntn-audiences/syncAudience/index.ts | Defines the Sync Audience action fields, defaults, and perform/performBatch wiring. |
| packages/destination-actions/src/destinations/mntn-audiences/syncAudience/functions.ts | Core sync logic: build identity payloads, route adds/removes, handle batching and per-index errors. |
| packages/destination-actions/src/destinations/mntn-audiences/syncAudience/types.ts | Adds types for identity payloads and internal batching bookkeeping. |
| packages/destination-actions/src/destinations/mntn-audiences/syncAudience/generated-types.ts | Generated action payload type for Sync Audience. |
| packages/destination-actions/src/destinations/mntn-audiences/tests/destination.test.ts | Unit tests for auth + audience lifecycle methods. |
| packages/destination-actions/src/destinations/mntn-audiences/tests/syncAudience.test.ts | Unit tests for sync behavior (add/remove, batch, normalization, duplicate handling, error paths). |
Comments suppressed due to low confidence (1)
packages/destination-actions/src/destinations/mntn-audiences/syncAudience/functions.ts:98
- Batch add/remove routing uses a truthy check (
if (audienceMemberships[index]) ... else ...). IfaudienceMemberships[index]isundefined(missing membership info), this will be treated as a removal and send a DELETE. Handle membership explicitly (=== truefor add,=== falsefor remove) and markundefinedas a validation error (for batch: set an error response at that index; for non-batch: throw aPayloadValidationError).
const identity = buildIdentity(p)
if (audienceMemberships[index]) {
adds.push({ index, p, identity })
} else {
removes.push({ index, p, identity })
}
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hi @valerie-mntn, Please review the code in this PR. Some important changes.
Best regards, |
|
Hi @joe-ayoub-segment apologies for the delay as it was a US holiday today. ACK on the changes you made (advertiser_id not needed in the code and phone & email hashed and un-hashed versions accepted). Regarding this comment: I think the correct default for IP should be Thank you |
Thanks Valerie, I changed the defaults for IP as context.ip is not the location where these values will be when when a user is added or removed from an Audience. context.ip is just for events coming in to Segment from various source platforms. If you are happy with the code then I will label it for deploy. |
|
got it, thanks @joe-ayoub-segment. We are running into issues testing our batch DELETE endpoint, so our team is currently looking into it. I hope to have an update for you some time tomorrow (Wednesday US timezone). Apologies for the delay! |
|
Hi @joe-ayoub-segment , just a quick update from our side - we're making a fix to our batch delete API and it will be deployed on Monday. I was able to successfully run all other tests locally, so all good there. I'll send another update on Monday when I've tested the batch delete, and we should be good to go for you to deploy. Thanks for the patience! |
|
hi @joe-ayoub-segment , batch delete was fixed on our end and I ran this code locally and all tests passed successfully. We can proceed with having you deploy our integration. please let us know of any next steps after deployment. thank you! |
Thanks for testing the integration @valerie-mntn . Glad the issue was caught before deploying the change. |
|
Hi @joe-ayoub-segment , here is the output from running a live integration test script against the MNTN Audience API (all endpoints, real API key, no mocking): ── 1. testAuthentication ────────────────────────────── |
|
Thanks @valerie-mntn . We're in a deploy freeze at the moment. But I'll deploy this code as soon as I can. I've labelled it for release - so nothing left to do until I deploy it. |
|
Hi @joe-ayoub-segment , any new updates here? thanks so much |
|
Not yet @valerie-mntn . There's a lot of changes which need to be shipped and this one is in the queue. I'm hopefully that it will happen this week, but I can't be sure. |
|
Hi @joe-ayoub-segment hope all is well. I just submitted our documentation PR here as well: segment-boneyard/segment-docs#8212 Just wanted to confirm that is the right place to submit for review since I noticed the repo is no longer maintained? |
|
Hi Valerie,
No that's the wrong place.
Please share your email ***@***.***) and I'll send you a template.
There's a new internal company repository, and we haven't built a
submission capability.
Best regards,
Joe
…On Tue, Jun 16, 2026 at 7:16 PM valerie-mntn ***@***.***> wrote:
*valerie-mntn* left a comment (segmentio/action-destinations#3809)
<#3809 (comment)>
Hi @joe-ayoub-segment <https://github.com/joe-ayoub-segment> hope all is
well. I just submitted our documentation PR here as well:
segment-boneyard/segment-docs#8212
<segment-boneyard/segment-docs#8212>
Just wanted to confirm that is the right place to submit for review since
I noticed the repo is no longer maintained?
—
Reply to this email directly, view it on GitHub
<#3809?email_source=notifications&email_token=AK2F3MAAKOM4VPXAT4GYFAT5AGFIZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZSGE4TCOJTHAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4721919383>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK2F3MHRHJAK6QLXOSVPLW35AGFIZAVCNFSNUABFKJSXA33TNF2G64TZHMZTQMJXGY4TCMRXHNEXG43VMU5TINJQGMZDSMRVGI42C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AK2F3MASKVJVNWOHRJI22VT5AGFIZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZSGE4TCOJTHAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AK2F3MDXVRQCYKVEMKN5JGT5AGFIZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZSGE4TCOJTHAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Thanks @joe-ayoub-segment . Email is valerie@mountain.com |
|
Thanks @joe-ayoub-segment , I'll work on that docs submission today. Any updates you can share about this specific deployment and when your deploy freeze would be lifted? Appreciate it! |
|
HI @joe-ayoub-segment - I noticed Copilot ran some automated checks/reviews on this PR. Do I need to take any action given your green light / go-ahead on my submission (and the updated changes per your comments) a few weeks ago? Please let me know - thanks |
Defaulting audienceMembership to `[]` (and treating an undefined entry as falsey) meant a missing membership classified an identity as a removal, risking unintended DELETEs. syncAudience now requires an explicit boolean per entry: `perform` throws a PayloadValidationError, and `performBatch` marks the entry as a 400 in the MultiStatusResponse instead of deleting it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a33f122 to
fe561a4
Compare
Hi @valerie-mntn - thanks for pointing out. One of them was worth looking at. I pushed a commit. |
New Audience destination for MNTN
Testing
Unit tests added.
Testing will be done in private beta
Original Partner PR here: #3796
Partner testing.

Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'New Destination Checklist
verioning-info.tsfile. example