Skip to content

feat: push replay and person links into external integrations #1980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented May 28, 2025

if you've got intercom or crisp chat on your site, you might want to auto-link session replay to user interactions

you can do this manually but it might be nice to make it easy for folk

crisp

Screenshot 2025-05-29 at 11 56 04

intercom

Screenshot 2025-05-29 at 11 16 32 Screenshot 2025-05-29 at 11 16 28

Copy link

vercel bot commented May 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Jun 12, 2025 0:35am

greptile-apps[bot]

This comment was marked as outdated.

Copy link

github-actions bot commented May 28, 2025

Copy link

github-actions bot commented May 28, 2025

Size Change: -11 kB (-0.31%)

Total Size: 3.52 MB

Filename Size Change
dist/all-external-dependencies.js 217 kB -2.5 kB (-1.14%)
dist/array.full.es5.js 301 kB -831 B (-0.28%)
dist/array.full.js 366 kB -1.7 kB (-0.46%)
dist/array.full.no-external.js 383 kB -1.68 kB (-0.44%)
dist/array.js 169 kB +798 B (+0.48%)
dist/array.no-external.js 184 kB +818 B (+0.45%)
dist/main.js 170 kB +798 B (+0.47%)
dist/module.full.js 366 kB -1.7 kB (-0.46%)
dist/module.full.no-external.js 383 kB -1.68 kB (-0.44%)
dist/module.js 170 kB +798 B (+0.47%)
dist/module.no-external.js 184 kB +818 B (+0.45%)
dist/surveys-preview.js 67.8 kB -2.5 kB (-3.55%)
dist/surveys.js 75.6 kB -2.5 kB (-3.2%)
ℹ️ View Unchanged
Filename Size
dist/crisp-chat-integration.js 1.92 kB
dist/customizations.full.js 11 kB
dist/dead-clicks-autocapture.js 12.6 kB
dist/exception-autocapture.js 9.55 kB
dist/external-scripts-loader.js 2.57 kB
dist/intercom-integration.js 1.98 kB
dist/posthog-recorder.js 207 kB
dist/recorder-v2.js 113 kB
dist/recorder.js 113 kB
dist/tracing-headers.js 1.58 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@pauldambra pauldambra changed the title feat: push replay link into intercom feat: push replay and person links into external integrations May 28, 2025
This will let us extend our code much more easily in the future. We're also saving us some bytes :)
A `Record` requires all keys to exist but we dont need that, let's use a mapped object instead
@rafaeelaudibert
Copy link
Member

I've rerun CI several times and this keeps failing, I dont think it's flaky, we might be using something that doesnt work on IE11

@pauldambra
Copy link
Member Author

we might be using something that doesnt work on IE11

weirdly it's almost all types or external and i haven't added the externals to the es5 bundle 😡

}

public startIfEnabledOrStop() {
for (const [key, value] of Object.entries(this._instance.config.integrations ?? {})) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ie11 giving

JavaScript error details:
TypeError: Object doesn't support property or method 'entries'
at t.startIfEnabledOrStop

but we polyfill it https://github.com/PostHog/posthog-js/pull/1980/files#diff-001e332a80712cf09955389a80c7dd2eaf800699391a5145792eb41337dd18eeR8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! This is Object.entries not Object.fromEntries

dangnammit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, before this polyfill we had

dist/array.full.es5.js | 300 kB | +914 B (+0.31%)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist/array.full.es5.js | 301 kB | +1.73 kB (+0.58%)

not too bad... assuming it works

@pauldambra pauldambra added the bump minor Bump minor version when this PR gets merged label Jun 12, 2025
@pauldambra
Copy link
Member Author

ok @rafaeelaudibert @veryayskiy this is i think ready to go in

Copy link
Member

@rafaeelaudibert rafaeelaudibert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, just need to merge with master

@posthog-bot
Copy link
Collaborator

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@pauldambra
Copy link
Member Author

will recreate here instead #2039

@pauldambra pauldambra closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants