Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ef69d2e
Add GitHub Action to build and publish SDK to GitHub Packages
DanielO15 Jan 23, 2026
db9c465
Fix GitHub Packages authentication
DanielO15 Jan 23, 2026
e8b91cd
Use PACKAGES_TOKEN for GitHub Packages authentication
DanielO15 Jan 23, 2026
3537d98
Remove DataDog CLA workflow (not needed for fork)
DanielO15 Jan 23, 2026
225ae9c
Temporarily allow workflow to run on all branches for testing
DanielO15 Jan 23, 2026
110afd8
Fix build command - use yarn build:bundle without arguments
DanielO15 Jan 23, 2026
0491098
Fix: Create .npmrc in publish step where NODE_AUTH_TOKEN is available
DanielO15 Jan 23, 2026
e60dcec
corrected yml file to be in line with MV versions
DanielO15 Jan 23, 2026
db731f9
chore: remove DataDog Confluence workflow
DanielO15 Jan 23, 2026
60712bc
feat: add prettier check for PRs, run full lint/test only on main/tags
DanielO15 Jan 23, 2026
3bff5a1
formatting chages
DanielO15 Jan 23, 2026
2841505
format readme
DanielO15 Jan 23, 2026
b9c37c8
update yml for better follow MV pattern
DanielO15 Jan 26, 2026
3e2e408
eslint file for DD linter errors
DanielO15 Jan 26, 2026
6f7515e
eslintignore is deprecated
DanielO15 Jan 26, 2026
c9c33dc
update tests to accoutn for renames
DanielO15 Jan 26, 2026
f57b892
syntax and format
DanielO15 Jan 26, 2026
4bd5883
refactor: update old cookie names for session management
DanielO15 Jan 26, 2026
33c1f46
update the regex to allow underscores in the key for the name changes
DanielO15 Jan 26, 2026
ed75a7b
more ranmes!
DanielO15 Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/changelog-to-confluence.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/cla.yml

This file was deleted.

110 changes: 110 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Release Github Package

on:
push:
branches:
- main
tags:
- v*
# Note: paths filter intentionally omitted for push events.
# Adding paths would break tag-triggered releases since tag pushes
# don't have file changes to match against.
pull_request:
types:
- opened
- synchronize
paths:
- 'packages/**'
- '.github/workflows/release-package.yml'
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
GITHUB_READ_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '25.3.0'
- run: yarn install --frozen-lockfile
- run: yarn format
- run: yarn lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '25.3.0'
- run: yarn install --frozen-lockfile
- run: yarn test:unit

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '25.3.0'
- run: yarn install --frozen-lockfile
- run: yarn build:bundle

publish:
needs:
- lint
- test
- build
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
packages: write
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# Fetch all history and tags for proper versioning
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: '25.3.0'
registry-url: https://npm.pkg.github.com/
scope: '@multiverse-io'

- run: yarn install --frozen-lockfile
- run: yarn build:bundle

- name: Prepare RUM package for publishing
run: |
cd packages/rum
# Update package name to scoped version
node -e "const pkg=require('./package.json'); pkg.name='@multiverse-io/browser-rum'; pkg.publishConfig={registry:'https://npm.pkg.github.com', access:'public'}; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));"

- name: Publish to GitHub Packages
run: |
cd packages/rum
# Create .npmrc with auth token
echo "@multiverse-io:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN" >> .npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
packages/rum/bundle/**/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 9 additions & 7 deletions FORK_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ The challenge: When multiple applications on the same page try to use the standa
// Ariel's DataDog (standard SDK)
window.DD_RUM.init({
applicationId: 'ariel-app-id',
service: 'ariel'
service: 'ariel',
})

// Atlas tries to use DataDog too
window.DD_RUM.init({
applicationId: 'atlas-app-id',
service: 'atlas'
service: 'atlas',
})
// ❌ This overwrites Ariel's instance!
// ❌ Session tracking gets mixed between the two
Expand All @@ -37,13 +37,13 @@ This fork renames all DataDog globals to use the `ATLAS_SDK` prefix, allowing At
// Ariel's DataDog (standard SDK)
window.DD_RUM.init({
applicationId: 'ariel-app-id',
service: 'ariel'
service: 'ariel',
})

// Atlas DataDog (this fork)
window.ATLAS_SDK_DD_RUM.init({
applicationId: 'atlas-app-id',
service: 'atlas'
service: 'atlas',
})
// ✅ Both instances coexist peacefully
// ✅ Separate session tracking
Expand All @@ -55,24 +55,26 @@ window.ATLAS_SDK_DD_RUM.init({
All DataDog globals and storage keys have been renamed with the `ATLAS_SDK` prefix:

### Globals

- `window.DD_RUM` → `window.ATLAS_SDK_DD_RUM`
- `window.DD_LOGS` → `window.ATLAS_SDK_DD_LOGS`
- `window.DD_RUM_SYNTHETICS` → `window.ATLAS_SDK_DD_RUM_SYNTHETICS`
- `window.DD_SOURCE_CODE_CONTEXT` → `window.ATLAS_SDK_DD_SOURCE_CODE_CONTEXT`
- `window.DatadogEventBridge` → `window.AtlasSDKDatadogEventBridge`

### Storage Keys

- `_dd_s` → `_atlas_sdk_s` (session cookie)
- `_dd_c` → `_atlas_sdk_c` (context storage prefix)
- `_dd_test_` → `_atlas_sdk_test_` (localStorage test)

### Product Keys

- `rum` → `atlas-sdk-rum`
- `logs` → `atlas-sdk-logs`

This ensures complete isolation between Atlas's DataDog instance and any other DataDog instances on the same page.


## Known Limitations

As documented in [DataDog/browser-sdk#2994](https://github.com/DataDog/browser-sdk/issues/2994), some features cannot be fully separated between multiple instances:
Expand All @@ -90,11 +92,13 @@ You may need to add filtering in your `beforeSend` hooks to prevent cross-pollut
**Must be built with Node.js v22+ (we used v25.3.0)**

Check your Node version:

```bash
node --version # Should be v22.x or higher
```

If you need to switch Node versions:

```bash
nvm use 25.3.0 # or the version specified in package.json
```
Expand Down Expand Up @@ -127,7 +131,6 @@ yarn test
git push origin main
```


### Automated Rename (if needed)

The renames follow a consistent pattern. If you need to reapply them after a merge, you can use find/replace:
Expand All @@ -138,7 +141,6 @@ The renames follow a consistent pattern. If you need to reapply them after a mer
- `'_dd_c'` → `'_atlas_sdk_c'`
- etc.


## Links

- **Upstream Repository:** https://github.com/DataDog/browser-sdk
Expand Down
3 changes: 1 addition & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export default tseslint.config(
'packages/*/cjs',
'packages/*/esm',
'test/**/dist',
'test/apps/react-heavy-spa',
'test/apps/react-shopist-like',
'test/apps/**', // Exclude all DataDog test apps (have inherited lint errors)
'sandbox',
'coverage',
'rum-events-format',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('displayAlreadyInitializedError', () => {
const displayErrorSpy = spyOn(display, 'error')
displayAlreadyInitializedError('ATLAS_SDK_DD_RUM', {} as InitConfiguration)
expect(displayErrorSpy).toHaveBeenCalledTimes(1)
expect(displayErrorSpy).toHaveBeenCalledWith('DD_RUM is already initialized.')
expect(displayErrorSpy).toHaveBeenCalledWith('ATLAS_SDK_DD_RUM is already initialized.')
})

it('should not display an error if the "silentMultipleInit" option is used', () => {
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/boot/displayAlreadyInitializedError.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { InitConfiguration } from '../domain/configuration'
import { display } from '../tools/display'

export function displayAlreadyInitializedError(sdkName: 'ATLAS_SDK_DD_RUM' | 'ATLAS_SDK_DD_LOGS', initConfiguration: InitConfiguration) {
export function displayAlreadyInitializedError(
sdkName: 'ATLAS_SDK_DD_RUM' | 'ATLAS_SDK_DD_LOGS',
initConfiguration: InitConfiguration
) {
if (!initConfiguration.silentMultipleInit) {
display.error(`${sdkName} is already initialized.`)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/domain/contexts/accountContext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('account context across pages', () => {
accountContext.setContext({ id: '123' })

expect(accountContext.getContext()).toEqual({ id: '123' })
expect(localStorage.getItem('_dd_c_rum_4')).toBeNull()
expect(localStorage.getItem('_atlas_sdk_c_rum_4')).toBeNull()
})

it('when enabled, should maintain the account in local storage', () => {
Expand All @@ -94,6 +94,6 @@ describe('account context across pages', () => {

accountContext.setContext({ id: 'foo', qux: 'qix' })
expect(accountContext.getContext()).toEqual({ id: 'foo', qux: 'qix' })
expect(localStorage.getItem('_dd_c_some_product_key_4')).toBe('{"id":"foo","qux":"qix"}')
expect(localStorage.getItem('_atlas_sdk_c_some_product_key_4')).toBe('{"id":"foo","qux":"qix"}')
})
})
4 changes: 2 additions & 2 deletions packages/core/src/domain/contexts/globalContext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('global context across pages', () => {
globalContext.setContext({ id: '123' })

expect(globalContext.getContext()).toEqual({ id: '123' })
expect(localStorage.getItem('_dd_c_some_product_key_2')).toBeNull()
expect(localStorage.getItem('_atlas_sdk_c_some_product_key_2')).toBeNull()
})

it('when enabled, should maintain the global context in local storage', () => {
Expand All @@ -83,6 +83,6 @@ describe('global context across pages', () => {

globalContext.setContext({ id: 'foo', qux: 'qix' })
expect(globalContext.getContext()).toEqual({ id: 'foo', qux: 'qix' })
expect(localStorage.getItem('_dd_c_some_product_key_2')).toBe('{"id":"foo","qux":"qix"}')
expect(localStorage.getItem('_atlas_sdk_c_some_product_key_2')).toBe('{"id":"foo","qux":"qix"}')
})
})
4 changes: 2 additions & 2 deletions packages/core/src/domain/contexts/userContext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('user context across pages', () => {
userContext.setContext({ id: '123' })

expect(userContext.getContext()).toEqual({ id: '123' })
expect(localStorage.getItem('_dd_c_some_product_key_1')).toBeNull()
expect(localStorage.getItem('_atlas_sdk_c_some_product_key_1')).toBeNull()
})

it('when enabled, should maintain the user in local storage', () => {
Expand All @@ -151,6 +151,6 @@ describe('user context across pages', () => {

userContext.setContext({ id: 'foo', qux: 'qix' })
expect(userContext.getContext()).toEqual({ id: 'foo', qux: 'qix' })
expect(localStorage.getItem('_dd_c_some_product_key_1')).toBe('{"id":"foo","qux":"qix"}')
expect(localStorage.getItem('_atlas_sdk_c_some_product_key_1')).toBe('{"id":"foo","qux":"qix"}')
})
})
Loading
Loading