diff --git a/apps/docs/.env.example b/apps/docs/.env.example
new file mode 100644
index 00000000..d5de49be
--- /dev/null
+++ b/apps/docs/.env.example
@@ -0,0 +1 @@
+NEXT_PUBLIC_OPENPANEL_CLIENT_ID=
\ No newline at end of file
diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjs
index a27eb759..37c8936f 100644
--- a/apps/docs/astro.config.mjs
+++ b/apps/docs/astro.config.mjs
@@ -1,7 +1,7 @@
import sitemap from "@astrojs/sitemap";
import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";
-import { defineConfig } from "astro/config";
+import { defineConfig, envField } from "astro/config";
import starlightSidebarTopics from "starlight-sidebar-topics";
import Icons from "unplugin-icons/vite";
@@ -11,6 +11,14 @@ export default defineConfig({
vite: {
plugins: [Icons({ compiler: "astro" })],
},
+ env: {
+ schema: {
+ NEXT_PUBLIC_OPENPANEL_CLIENT_ID: envField.string({
+ access: "public",
+ context: "client",
+ }),
+ },
+ },
integrations: [
sitemap(),
starlight({
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 9f809e3a..99986023 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -16,6 +16,7 @@
"@astrojs/starlight": "0.32.6",
"@astrojs/starlight-tailwind": "3.0.1",
"@astrojs/tailwind": "6.0.0",
+ "@openpanel/astro": "1.0.1",
"astro": "5.6.1",
"sharp": "0.33.5",
"starlight-showcases": "0.3.0",
diff --git a/apps/docs/src/components/Head.astro b/apps/docs/src/components/Head.astro
index 819637f4..f4e97b78 100644
--- a/apps/docs/src/components/Head.astro
+++ b/apps/docs/src/components/Head.astro
@@ -1,6 +1,7 @@
---
+import { NEXT_PUBLIC_OPENPANEL_CLIENT_ID } from "astro:env/client";
import Default from "@astrojs/starlight/components/Head.astro";
-
+import { OpenPanelComponent } from "@openpanel/astro";
const title = Astro.locals.starlightRoute.title;
const { siteTitle } = Astro.locals.starlightRoute;
@@ -17,3 +18,5 @@ const url = `https://openstatus.dev/api/og?title=${siteTitle}&description=${titl
+
+
\ No newline at end of file
diff --git a/apps/server/.env.example b/apps/server/.env.example
index 89773de5..4f4fafd3 100644
--- a/apps/server/.env.example
+++ b/apps/server/.env.example
@@ -12,5 +12,5 @@ TWILLIO_ACCOUNT_ID=your_account_id
SCREENSHOT_SERVICE_URL=http://your.endpoint
QSTASH_TOKEN=your_token
-OPENPANEL_CLIENT_ID=
+NEXT_PUBLIC_OPENPANEL_CLIENT_ID=
OPENPANEL_CLIENT_SECRET=
\ No newline at end of file
diff --git a/apps/server/.env.test b/apps/server/.env.test
index dfc6ddf6..a9ab6f16 100644
--- a/apps/server/.env.test
+++ b/apps/server/.env.test
@@ -11,5 +11,5 @@ FLY_REGION=ams
RESEND_API_KEY=test
SQLD_HTTP_AUTH=basic:token
SCREENSHOT_SERVICE_URL=http://your.endpoint
-OPENPANEL_CLIENT_ID=test
+NEXT_PUBLIC_OPENPANEL_CLIENT_ID=test
OPENPANEL_CLIENT_SECRET=test
\ No newline at end of file
diff --git a/apps/web/.env.example b/apps/web/.env.example
index 039622f5..c1c8ad00 100644
--- a/apps/web/.env.example
+++ b/apps/web/.env.example
@@ -74,5 +74,5 @@ WORKSPACES_LOOKBACK_30=
# https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#loose-mode
TURBO_ENV_MODE=loose
-OPENPANEL_CLIENT_ID=something
+NEXT_PUBLIC_OPENPANEL_CLIENT_ID=something
OPENPANEL_CLIENT_SECRET=something
diff --git a/apps/web/package.json b/apps/web/package.json
index c6151d02..dbb42730 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -16,6 +16,7 @@
"@google-cloud/tasks": "4.0.1",
"@hookform/resolvers": "3.9.1",
"@libsql/client": "0.14.0",
+ "@openpanel/nextjs": "^1.0.8",
"@openstatus/analytics": "workspace:*",
"@openstatus/api": "workspace:*",
"@openstatus/assertions": "workspace:*",
@@ -26,9 +27,9 @@
"@openstatus/notification-discord": "workspace:*",
"@openstatus/notification-emails": "workspace:*",
"@openstatus/notification-ntfy": "workspace:*",
+ "@openstatus/notification-opsgenie": "workspace:*",
"@openstatus/notification-pagerduty": "workspace:*",
"@openstatus/notification-slack": "workspace:*",
- "@openstatus/notification-opsgenie": "workspace:*",
"@openstatus/notification-webhook": "workspace:*",
"@openstatus/react": "workspace:*",
"@openstatus/tinybird": "workspace:*",
diff --git a/apps/web/src/app/app/layout.tsx b/apps/web/src/app/app/layout.tsx
index 30e2097d..da92a96e 100644
--- a/apps/web/src/app/app/layout.tsx
+++ b/apps/web/src/app/app/layout.tsx
@@ -1,16 +1,22 @@
import { SessionProvider } from "next-auth/react";
import { Bubble } from "@/components/support/bubble";
+import { auth } from "@/lib/auth";
+import { IdentifyComponent } from "@openpanel/nextjs";
-export default function AuthLayout({
+export default async function AuthLayout({
children, // will be a page or nested layout
}: {
children: React.ReactNode;
}) {
+ const session = await auth();
return (
-
+
{children}
+ {session?.user?.id && (
+
+ )}
);
}
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 0a5d7eaf..f53e6b51 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -1,11 +1,11 @@
import "@/styles/globals.css";
+import { Toaster } from "@/components/ui/sonner";
+import { OpenPanelComponent } from "@openpanel/nextjs";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import LocalFont from "next/font/local";
-import { Toaster } from "@/components/ui/sonner";
-
import {
defaultMetadata,
ogMetadata,
@@ -13,6 +13,7 @@ import {
} from "@/app/shared-metadata";
import { TailwindIndicator } from "@/components/tailwind-indicator";
import { ThemeProvider } from "@/components/theme-provider";
+import { env } from "@/env";
import { TRPCReactQueryProvider } from "@/trpc/rq-client";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import Background from "./_components/background";
@@ -56,6 +57,14 @@ export default function RootLayout({
+ {env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID && (
+
+ )}