
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@adv-re/segment-wrapper
Advanced tools
Modern TypeScript abstraction layer on top of the Segment Analytics library with built-in support for Segment integrations, Adobe Analytics, TCF compliance, and consent management.
npm install @adv-re/segment-wrapper
import analytics from '@adv-re/segment-wrapper'
import {initConfig} from '@adv-re/segment-wrapper'
// Initialize configuration (optional - for custom settings)
initConfig({
userIdPrefix: 'fc-',
adobeMarketingCloudOrgId: 'YOUR_ORG_ID@AdobeOrg',
sendXandrId: true,
defaultProperties: {
platform: 'web'
}
})
// Track events
await analytics.track('Button Clicked', {
buttonName: 'Sign Up',
location: 'Homepage'
})
// Track page views
await analytics.page('Homepage', {
title: 'Welcome to Our Site'
})
// Identify users
await analytics.identify('user-123', {
email: 'user@example.com',
plan: 'premium'
})
<script src="https://cdn.segment.com/analytics.js/v1/YOUR_WRITE_KEY/analytics.min.js"></script>
<!-- Use specific version (recommended for production) -->
<script async src="https://unpkg.com/@adv-re/segment-wrapper@latest"></script>
<script>
// Access via window.sui.analytics
window.sui.analytics.track('Page Viewed', {
page: 'home'
})
</script>
Version Options:
<!-- Specific version (recommended for production) -->
<script async src="https://unpkg.com/@adv-re/segment-wrapper@5.0.0"></script>
<!-- Latest version (use only for development) -->
<script async src="https://unpkg.com/@adv-re/segment-wrapper"></script>
import {initConfig} from '@adv-re/segment-wrapper'
initConfig({
// User ID Configuration
userIdPrefix: 'fc-',
// Adobe Analytics
adobeMarketingCloudOrgId: 'YOUR_ORG_ID@AdobeOrg',
// Xandr ID
sendXandrId: true,
// Default Properties (added to all track calls)
defaultProperties: {
platform: 'web',
app: 'my-app'
},
// Middlewares
experimentalPageDataMiddleware: false
})
See Configuration Guide for all available options.
analytics.track(event, properties?, context?, callback?) - Track custom eventsanalytics.page(name?, properties?, context?, callback?) - Track page viewsanalytics.identify(userId, traits?, options?, callback?) - Identify usersanalytics.reset() - Reset user identificationgetConfig(key) - Get configuration valuesetConfig(key, value) - Set configuration valueclearConfig() - Clear all configurationgetUniversalId() - Get current Universal IDgetAdobeMCVisitorID() - Get Adobe Marketing Cloud Visitor IDgetAdobeVisitorData() - Get Adobe Visitor API datagetCampaignDetails() - Get UTM/STC campaign parameters from URLSee API Reference for detailed documentation.
The segment-wrapper includes a powerful middleware system that allows you to modify tracking data before it's sent:
// Middlewares are automatically registered on initialization
// They enrich events with:
// - User traits (anonymous ID, user ID)
// - Campaign context (UTM parameters, STC tracking)
// - Page referrer information
// - Screen dimensions
// - Default context properties
See Middleware Documentation for more details.
Built-in support for Transparency & Consent Framework (TCF) v2:
import {getGdprPrivacyValue, checkAnalyticsGdprIsAccepted} from '@adv-re/segment-wrapper'
// Get current GDPR consent state
const gdprValue = await getGdprPrivacyValue()
// { analytics: 'accepted', advertising: 'declined' }
// Check if analytics tracking is allowed
const canTrack = checkAnalyticsGdprIsAccepted(gdprValue)
Events are automatically blocked or modified based on user consent.
See TCF Documentation for more details.
Automatic UTM and STC campaign parameter parsing:
import {getCampaignDetails} from '@adv-re/segment-wrapper'
// Get campaign details from URL
const campaign = getCampaignDetails()
// Returns: { utm_source: 'google', utm_medium: 'cpc', ... }
// Campaign parameters are automatically added to all events
// via the campaignContext middleware
Features:
See Upgrade to v5 Guide for step-by-step instructions on upgrading to version 5.
Key changes in v5:
googleAnalyticsMeasurementId, googleAnalyticsConfig, etc. configuration optionsSee Migration Guide for step-by-step instructions on migrating from the legacy @s-ui/segment-wrapper package.
Key changes:
@s-ui/segment-wrapper → @adv-re/segment-wrapper# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
# Build UMD bundle
npm run build:umd
# Lint
npm run lint
ISC
FAQs
Modern TypeScript abstraction layer on top of the Segment library
The npm package @adv-re/segment-wrapper receives a total of 2,953 weekly downloads. As such, @adv-re/segment-wrapper popularity was classified as popular.
We found that @adv-re/segment-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 38 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.