/
githubmirror
/
Front-End-Checklist
Обзор
Документация
Войти
/
githubmirror
/
Front-End-Checklist
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/analytics/server.ts
18 строк
555 B
David Dias
fix: point OpenPanel at self-hosted API
11 авг 2026, 06:34
11 авг 2026, 06:34
fafddc2
Код
Авторство
О чём код?
import 'server-only' import { OpenPanel } from '@openpanel/sdk' const clientId = process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID?.trim() ?? '' const clientSecret = process.env.OPENPANEL_CLIENT_SECRET?.trim() ?? '' /** Self-hosted OpenPanel API base (includes `/api`). */ export const openPanelApiUrl = process.env.OPENPANEL_API_URL?.trim() || 'https://stats.daviddias.digital/api' export const hasOpenPanelServerConfig = Boolean(clientId && clientSecret) export const opServer = new OpenPanel({ apiUrl: openPanelApiUrl, clientId, clientSecret })