feat: Update @dub/analytics to support domainsConfig.refer (#20495)

* Update `@dub/analytics` to support domainsConfig.refer

* add reverse proxy

---------

Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-04-03 16:32:58 -04:00
1 parent 0465c639e6
commit 6bc040b7bb
4 files changed
+15 -6

No files matched your search

+4
View File
@@ -317,9 +317,13 @@ export default function Signup({
</>
)}
<DubAnalytics
apiHost="/_proxy/dub"
cookieOptions={{
domain: isENVDev ? undefined : `.${new URL(WEBSITE_URL).hostname}`,
}}
domainsConfig={{
refer: "refer.cal.com",
}}
/>
</>
) : null}
+5
View File
@@ -391,6 +391,11 @@ const nextConfig = {
source: "/icons/sprite.svg",
destination: `${process.env.NEXT_PUBLIC_WEBAPP_URL}/icons/sprite.svg`,
},
// for @dub/analytics, @see: https://d.to/reverse-proxy
{
source: "/_proxy/dub/track/:path",
destination: "https://api.dub.co/track/:path",
},
// When updating this also update pagesAndRewritePaths.js
...[
+1 -1
View File
@@ -44,7 +44,7 @@
"@calcom/ui": "*",
"@daily-co/daily-js": "^0.76.0",
"@daily-co/daily-react": "^0.22.0",
"@dub/analytics": "^0.0.15",
"@dub/analytics": "^0.0.27",
"@dub/embed-core": "^0.0.10",
"@dub/embed-react": "^0.0.10",
"@formkit/auto-animate": "1.0.0-beta.5",
+5 -5
View File
@@ -3809,7 +3809,7 @@ __metadata:
"@calcom/ui": "*"
"@daily-co/daily-js": ^0.76.0
"@daily-co/daily-react": ^0.22.0
"@dub/analytics": ^0.0.15
"@dub/analytics": ^0.0.27
"@dub/embed-core": ^0.0.10
"@dub/embed-react": ^0.0.10
"@formkit/auto-animate": 1.0.0-beta.5
@@ -4438,12 +4438,12 @@ __metadata:
languageName: node
linkType: hard
"@dub/analytics@npm:^0.0.15":
version: 0.0.15
resolution: "@dub/analytics@npm:0.0.15"
"@dub/analytics@npm:^0.0.27":
version: 0.0.27
resolution: "@dub/analytics@npm:0.0.27"
dependencies:
server-only: ^0.0.1
checksum: afff2252db4a43593efc5c990fd684b5423f47978191078d3b788a7c3e51f912cf21a65d4cfdffe57a20dbe3a89c5f4ac47ff2899e266ae4ac0653a58ff0076f
checksum: 8c617f2911593a356c663dddd82395693c9d96db71ac0c96f8b7d4f3588de5a2764797e610c7c6958011c6c2e63244eeb2681ef17548769f0bf7fd6d8f11fac7
languageName: node
linkType: hard