Skip to content

Commit

Permalink
fix: check window in swetrix component
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Jul 11, 2024
1 parent 4862a14 commit 4b6f43e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/analytics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { usePathname } from 'next/navigation'
function SwetrixComponent() {
const pathname = usePathname()

if (window.location.host === 'briefkastenhq.com') {
if (
typeof window !== 'undefined' &&
window.location.host === 'briefkastenhq.com'
) {
Swetrix.init(process.env.NEXT_PUBLIC_SWETRIX_PROJECT, {
apiURL: process.env.NEXT_PUBLIC_SWETRIX_API_HOST,
})
Expand Down

0 comments on commit 4b6f43e

Please # to comment.