Skip to content

feat: migrate addressable over to hypelabs - #87

Merged
0xApotheosis merged 2 commits into
developfrom
11181_addressable_to_hypelabs
Dec 16, 2025
Merged

0xApotheosis merged 2 commits into
developfrom
11181_addressable_to_hypelabs

Conversation

@premiumjibles

@premiumjibles premiumjibles commented Dec 16, 2025 •

Copy link
Copy Markdown
Contributor

Replaces Addressable Pixel with HypeLabs Pixel as per marketing request

Sister PR in web: shapeshift/web#11420

For testing:

  • Turn off any adblock
  • Make sure you don't see any errors in the console for ha-sdk or api.hypelab
  • Check that window.HypeLabAnalytics is defined
  • Try running window.HypeLabAnalytics.logEvent('test_event') in the console and see if the event appears in window.__hype_analytics

Summary by CodeRabbit

  • Chores
    • Updated analytics service integration to use a new provider
    • Modified security configuration to enable the updated analytics infrastructure

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Dec 16, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
website-frontend Ready Ready Preview, Comment Dec 16, 2025 0:43am

@coderabbitai

coderabbitai Bot commented Dec 16, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Analytics provider integration has been switched from adrsbl to Hypelab. The Script component in the layout was updated to initialize HypeLabAnalytics instead of the previous adrsbl loader, and middleware CSP directives were modified to permit hypelab.com domains in script-src and connect-src while removing adrsbl references.

Changes

Cohort / File(s) Summary
Analytics provider migration
app/layout.tsx
Replaced adrsbl Script component with Hypelab analytics loader; changed script id from "adrsbl" to "hypelab", updated inline initialization to call HypeLabAnalytics, set environment and client via onload, and load SDK asynchronously from hypelab.com; removed preconnect link to adrsbl.io
Content-Security-Policy update
middleware.ts
Updated CSP header to replace tag.adrsbl.io with api.hypelab.com and related domains in script-src and connect-src directives; nonce and other CSP rules remain unchanged

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Verify HypeLabAnalytics object and initialization logic are correctly implemented
  • Confirm all necessary hypelab.com subdomains are included in CSP directives
  • Ensure old adrsbl references are fully removed and no orphaned code remains

Possibly related PRs

  • feat: adrsbl pixel #52: Directly modifies the same analytics provider switch and CSP entries, replacing adrsbl with Hypelab integration in layout and middleware files.

Suggested reviewers

  • 0xApotheosis

Poem

🐰 A hop from old ads to Hypelab bright,
Where analytics now dance in the night,
CSP gates let the new SDK through,
The Script tag whispers "Hello, something new!" ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: migrate addressable over to hypelabs' directly and accurately summarizes the main change: replacing the Addressable analytics integration with Hypelab across layout.tsx and middleware.ts.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 11181_addressable_to_hypelabs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
middleware.ts (1)

165-166: CSP changes correctly allow Hypelab domains.

The script-src and connect-src directives properly include https://api.hypelab.com to support the new Hypelab SDK. The migration from adrsbl.io domains appears complete.

Consider breaking this long CSP string into a template literal with separate lines for each directive to improve maintainability:

const cspHeader = [
  "default-src 'self'",
  `script-src 'self' 'nonce-${nonce}' https://api.hypelab.com https://app.chatwoot.com https://widget.chatwoot.com https://cdn.weglot.com`,
  // ... other directives
].join('; ')
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 99cacab and 6df51d9.

📒 Files selected for processing (2)
  • app/layout.tsx (1 hunks)
  • middleware.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: thesmithdao
Repo: shapeshift/website-frontend PR: 52
File: app/layout.tsx:57-62
Timestamp: 2025-08-11T16:14:56.571Z
Learning: In the ShapeShift website-frontend repository, the adrsbl tracking pixel TID can be kept hardcoded in the app/layout.tsx file rather than being sourced from environment variables, as the team considers this value public and non-sensitive.
📚 Learning: 2025-08-11T16:14:56.571Z
Learnt from: thesmithdao
Repo: shapeshift/website-frontend PR: 52
File: app/layout.tsx:57-62
Timestamp: 2025-08-11T16:14:56.571Z
Learning: In the ShapeShift website-frontend repository, the adrsbl tracking pixel TID can be kept hardcoded in the app/layout.tsx file rather than being sourced from environment variables, as the team considers this value public and non-sensitive.

Applied to files:

  • app/layout.tsx
📚 Learning: 2025-08-20T22:37:17.653Z
Learnt from: thesmithdao
Repo: shapeshift/website-frontend PR: 58
File: app/[lang]/_utils/constants.tsx:877-879
Timestamp: 2025-08-20T22:37:17.653Z
Learning: In the ShapeShift website frontend, redirect entries in next.config.ts are kept for SEO purposes even when partner logos are removed from carouselLogos in constants.tsx. This preserves search rankings and link equity from legacy integrations while removing them from active promotion.

Applied to files:

  • app/layout.tsx
🔇 Additional comments (1)
app/layout.tsx (1)

56-74: Hypelab SDK integration looks correct.

The script properly initializes the HypeLabAnalytics stub before loading the SDK asynchronously. The hardcoded propertySlug is acceptable per team conventions (tracking IDs are considered public). Based on learnings, this is consistent with how the previous adrsbl TID was handled.

One item to verify: the trackAllSessions: true privacy setting. Please confirm this aligns with your privacy policy and any GDPR/CCPA consent requirements, as it enables session tracking for all users.

@0xApotheosis 0xApotheosis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ Make sure you don't see any errors in the console for ha-sdk or api.hypelab
✅ Check that window.HypeLabAnalytics is defined
✅ Try running window.HypeLabAnalytics.logEvent('test_event') in the console and see if the event appears in window.__hype_analytics

@0xApotheosis
0xApotheosis merged commit 30d9429 into develop Dec 16, 2025
4 checks passed
@0xApotheosis
0xApotheosis deleted the 11181_addressable_to_hypelabs branch December 16, 2025 00:48

This branch was previously deployed

1 inactive deployment
Preview — b58884e8 Deployed Dec 16, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants