Skip to content

Commit 4b6f43e

Browse files
committed
fix: check window in swetrix component
1 parent 4862a14 commit 4b6f43e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/analytics.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { usePathname } from 'next/navigation'
77
function SwetrixComponent() {
88
const pathname = usePathname()
99

10-
if (window.location.host === 'briefkastenhq.com') {
10+
if (
11+
typeof window !== 'undefined' &&
12+
window.location.host === 'briefkastenhq.com'
13+
) {
1114
Swetrix.init(process.env.NEXT_PUBLIC_SWETRIX_PROJECT, {
1215
apiURL: process.env.NEXT_PUBLIC_SWETRIX_API_HOST,
1316
})

0 commit comments

Comments
 (0)