Skip to content

Add support for MoEngage Datacenter 04 (api-04.moengage.com) #4970

@yugalbfleek

Description

@yugalbfleek

Issue Title

Feature Request: Add support for MoEngage Datacenter 04 (api-04.moengage.com)

Issue Body

## Summary

Currently, RudderStack's MoEngage destination only supports three datacenters:
- US → api-01.moengage.com
- EU → api-02.moengage.com  
- IND → api-03.moengage.com

MoEngage has a fourth datacenter (Datacenter 04) that uses `api-04.moengage.com`, but there's no way to configure this in RudderStack.

## Use Case

We need to route events to MoEngage's Datacenter 04 endpoint for compliance or performance reasons. Currently, users with accounts on datacenter-04 cannot use RudderStack's MoEngage destination.

## Current Behavior

1. **Transformer Code**: The region mapping in `src/v0/destinations/moengage/config.js` only includes US, EU, and IND
2. **UI Configuration**: The destination configuration UI only shows three region options (US, EU, IND)
3. **Error**: Setting region to "DC04" or any other value results in a configuration error

## Expected Behavior

1. Add "DC04" or "Datacenter 04" as a selectable region option in the UI
2. Support routing to `api-04.moengage.com` when DC04 is selected
3. Maintain backward compatibility with existing US/EU/IND configurations

## Proposed Solution

### Option 1: Add DC04 as a Standard Region
- Add DC04 to the endpoints mapping in transformer code
- Update destination definition schema to include DC04 in UI dropdown
- This would be the cleanest approach for users

### Option 2: Support Custom Datacenter
- Add a "Custom Datacenter" field that allows users to specify any datacenter number (1-6)
- More flexible but requires UI changes

### Option 3: Environment Variable Override
- Allow `MOENGAGE_API_ENDPOINT` environment variable to override the endpoint
- Less user-friendly but easier to implement

## Technical Details

**Files that need changes:**
- `rudder-transformer/src/v0/destinations/moengage/config.js` - Add DC04 endpoints
- Destination definition schema (in `rudder-server` or `config-generator`) - Add DC04 to UI options

**Current code structure:**
```javascript
const endpoints = {
  US: { /* api-01.moengage.com */ },
  EU: { /* api-02.moengage.com */ },
  IND: { /* api-03.moengage.com */ }
};

Proposed addition:

DC04: {
  identify: `https://api-04.moengage.com/v1/${endpointPaths.identify}/`,
  track: `https://api-04.moengage.com/v1/${endpointPaths.track}/`,
  device: `https://api-04.moengage.com/v1/${endpointPaths.device}/`,
  alias: `https://api-04.moengage.com/v1/${endpointPaths.alias}?app_id=`,
}

Possible Repositories impacted

Primary: rudderlabs/rudder-transformer
Secondary (if UI-related): rudderlabs/rudder-server or rudderlabs/config-generator

Questions

  1. Is there a reason DC04 was not included initially? (e.g., not available at the time)
  2. Would the team be open to a PR adding DC04 support?
  3. Which repository should I submit the PR to? (transformer, server, or both?)

Additional Context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions