Skip to content

Conversation

@odyssey2122
Copy link

@odyssey2122 odyssey2122 commented Dec 18, 2025

A summary of your pull request, including the what change you're making and why.

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Security Review

Please ensure sensitive data is properly protected in your integration.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

@odyssey2122
Copy link
Author

Hi @joe-ayoub-segment , the destination is now complete and ready for review. It includes two actions (trackEvent, identifyUser) with full test coverage. The catalog documentation PR is also submitted to segment-docs. Thanks!

@odyssey2122
Copy link
Author

This PR adds Collab Travel CRM as a new Segment destination. Collab Travel CRM is an all-in-one platform for modern travel agencies, helping them manage bookings, leads, proposals, and client relationships.

What's Included

Destination: collab-travel-crm

Actions:

  1. Identify User (identifyUser) - Creates or updates contacts in Collab Travel CRM from Segment identify events

    • Required field: email
    • Optional fields: firstName, lastName, phone, userId, traits
  2. Track Event (trackEvent) - Sends track events (bookings, leads, page views) to Collab Travel CRM

    • Required field: eventName
    • Optional fields: properties, userId, anonymousId, timestamp

Presets:

  • Track Events - Automatically subscribes to type = "track"
  • Identify Users - Automatically subscribes to type = "identify"

Authentication: Custom scheme using API Key (webhook secret)

Endpoint

All events are sent to: https://wvjaseexkfrcahmzfxkl.supabase.co/functions/v1/segment-destination

Why

Travel agencies using Collab Travel CRM want to:

  • Sync customer data from their websites and apps into their CRM
  • Track booking events, lead creation, and proposal engagement
  • Unify their customer data across marketing and analytics tools

Testing

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron

Unit Tests

All tests pass for both actions:

__tests__/index.test.ts - Destination-level tests

  • Authentication success/failure
  • Request extension (Authorization header)
  • Presets configuration

trackEvent/__tests__/index.test.ts - Track action tests

  • Sends events with all fields
  • Sends events with required fields only
  • Handles missing optional properties
  • Includes Authorization header
  • Handles server errors
  • Uses correct endpoint URL
  • Handles complex nested properties

identifyUser/__tests__/index.test.ts - Identify action tests

  • Sends identify with all fields
  • Sends identify with required email only
  • Handles missing email validation
  • Merges additional traits
  • Includes Authorization header
  • Handles server errors
  • Uses correct endpoint URL
  • Handles complex nested traits

End-to-End Testing

The webhook endpoint is live and has been tested with actual Segment payloads:

# Test authentication
curl -X POST https://wvjaseexkfrcahmzfxkl.supabase.co/functions/v1/segment-destination \
  -H "Authorization: Bearer test_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type":"track","event":"__segment_test__","properties":{"test":true}}'

# Test identify
curl -X POST https://wvjaseexkfrcahmzfxkl.supabase.co/functions/v1/segment-destination \
  -H "Authorization: Bearer test_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type":"identify","userId":"user_123","traits":{"email":"[email protected]","firstName":"John"}}'

# Test track
curl -X POST https://wvjaseexkfrcahmzfxkl.supabase.co/functions/v1/segment-destination \
  -H "Authorization: Bearer test_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type":"track","event":"Trip Booked","properties":{"order_id":"booking_456","revenue":2500}}'
Related PRs
Documentation PR: [segment-docs PR link]

---

**Copy everything between the `---` markers above** and paste it into your GitHub PR description.

**Don't forget to:**
1. Replace `[segment-docs PR link]` with the actual link to your segment-docs PR once you create it
2. After pasting, reply to Joe on the PR with: `@joe-ayoub-segment PR is now complete and ready for review!`

@joe-ayoub-segment
Copy link
Contributor

Hi @odyssey2122 looks like this is a duplicate of #3486

@joe-ayoub-segment
Copy link
Contributor

Duplicate of #3486

@joe-ayoub-segment joe-ayoub-segment marked this as a duplicate of #3486 Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants