Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ NEXT_PUBLIC_E2B_DOMAIN=e2b.dev
### OPTIONAL CLIENT ENVIRONMENT VARIABLES
### =================================

### Google Tag Manager container ID (set in production only)
# NEXT_PUBLIC_GTM_ID=

### PostHog analytics project key
# NEXT_PUBLIC_POSTHOG_KEY=

Expand Down
5 changes: 5 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@launchdarkly/node-server-sdk": "^9.11.2",
"@launchdarkly/openfeature-node-server": "^1.2.0",
"@next/env": "^16.2.7",
"@next/third-parties": "^16.2.10",
"@openfeature/server-sdk": "^1.22.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/auto-instrumentations-node": "^0.77.0",
Expand Down
2 changes: 0 additions & 2 deletions src/app/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { useParams } from 'next/navigation'
import type { ReactNode } from 'react'
import { GTMBody } from '@/features/google-tag-manager'
import { cn } from '@/lib/utils'

export function Body({
Expand All @@ -14,7 +13,6 @@ export function Body({

return (
<body className={cn(mode, 'relative flex min-h-[100svh] flex-col')}>
<GTMBody />
{children}
</body>
)
Expand Down
8 changes: 3 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import '@/app/fonts'
import '@/styles/globals.css'

import { GoogleTagManager } from '@next/third-parties/google'
import { Analytics } from '@vercel/analytics/next'
import { SpeedInsights } from '@vercel/speed-insights/next'
import Head from 'next/head'
import type { Metadata } from 'next/types'
import { Suspense } from 'react'
import { getFaviconIcons } from '@/configs/favicon'
import ClientProviders from '@/features/client-providers'
import { GTMHead } from '@/features/google-tag-manager'
import { Toaster } from '@/ui/primitives/toaster'
import { Body } from './body'

Expand Down Expand Up @@ -36,12 +35,11 @@ export default function RootLayout({
}) {
const postHogEnabled = !!process.env.NEXT_PUBLIC_POSTHOG_KEY
const postHogEnvironment = getPostHogEnvironment()
const gtmId = process.env.NEXT_PUBLIC_GTM_ID

return (
<html lang="en" suppressHydrationWarning>
<Head>
<GTMHead />
</Head>
{gtmId && <GoogleTagManager gtmId={gtmId} />}
<Body>
<ClientProviders
postHogEnabled={postHogEnabled}
Expand Down
34 changes: 0 additions & 34 deletions src/features/google-tag-manager.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const serverSchema = z.object({
export const clientSchema = z.object({
NEXT_PUBLIC_E2B_DOMAIN: z.string(),

NEXT_PUBLIC_GTM_ID: z.string().min(1).optional(),

NEXT_PUBLIC_POSTHOG_KEY: z.string().min(1).optional(),
NEXT_PUBLIC_POSTHOG_DASHBOARD_FEEDBACK_SURVEY_ID: z
.string()
Expand Down
Loading