diff --git a/apps/web/content/docs/developers/1.env.mdx b/apps/web/content/docs/developers/1.env.mdx index dd113baf99..016e543dc5 100644 --- a/apps/web/content/docs/developers/1.env.mdx +++ b/apps/web/content/docs/developers/1.env.mdx @@ -43,3 +43,37 @@ S3_REGION="local" ``` See `apps/web/package.json`, `apps/api/package.json`, and `apps/restate/package.json` to see how `.env.supabase` is used. + +# AI Server (`apps/ai`) + +The AI server uses the `envy` crate for structured environment configuration. Variables are loaded from `apps/ai/.env`: + +```bash +PORT=3001 # Server port (default: 3001) +SUPABASE_URL="..." # Supabase project URL +OPENROUTER_API_KEY="..." # OpenRouter API key for LLM proxy +SENTRY_DSN="..." # Optional: Sentry error tracking +POSTHOG_API_KEY="..." # Optional: PostHog analytics +DEEPGRAM_API_KEY="..." # Optional: Deepgram STT +ASSEMBLYAI_API_KEY="..." # Optional: AssemblyAI STT +SONIOX_API_KEY="..." # Optional: Soniox STT +FIREWORKS_API_KEY="..." # Optional: Fireworks STT +OPENAI_API_KEY="..." # Optional: OpenAI STT +GLADIA_API_KEY="..." # Optional: Gladia STT +ELEVENLABS_API_KEY="..." # Optional: ElevenLabs STT +``` + +# Web App (`apps/web`) + +The web app uses `@t3-oss/env-core` for validated environment variables. In development, all variables are optional. Key client-side variables: + +```bash +VITE_APP_URL="..." # App URL (default: http://localhost:3000) +VITE_API_URL="..." # API URL (default: https://api.hyprnote.com) +VITE_SUPABASE_URL="..." # Supabase URL +VITE_SUPABASE_ANON_KEY="..." # Supabase anon key +VITE_POSTHOG_API_KEY="..." # PostHog analytics key +VITE_POSTHOG_HOST="..." # PostHog host (default: https://us.i.posthog.com) +VITE_OUTLIT_PUBLIC_KEY="..." # Outlit pageview tracking key +VITE_SENTRY_DSN="..." # Optional: Sentry DSN +``` diff --git a/apps/web/content/docs/developers/12.analytics.mdx b/apps/web/content/docs/developers/12.analytics.mdx index 448c021ca7..5c41e69ec7 100644 --- a/apps/web/content/docs/developers/12.analytics.mdx +++ b/apps/web/content/docs/developers/12.analytics.mdx @@ -6,7 +6,7 @@ description: "Learn about analytics in Hyprnote" ## What are we tracking? -We use PostHog for analytics in both the web and desktop applications. The web application also uses Outlit for pageview tracking. You can opt-out from the settings menu in the desktop app. +We use PostHog for analytics in both the web and desktop applications. The web application also uses [Outlit](https://outlit.dev) for pageview tracking (configured via the `VITE_OUTLIT_PUBLIC_KEY` environment variable). You can opt-out from the settings menu in the desktop app. ## User Journey Events @@ -137,6 +137,41 @@ To track the user journey from website visit to active usage, use PostHog's funn PostHog's `$identify` event links anonymous device IDs to authenticated user IDs, enabling accurate conversion analysis across the entire user journey. +## Feature Flags + +Hyprnote uses PostHog feature flags to control feature rollouts. The system is split into two layers: + +- **`crates/flag`** - A standalone Rust client for evaluating PostHog feature flags via the `/flags` API. It returns typed `FlagValue` results with support for boolean flags, multivariate variants, and JSON payloads. +- **`plugins/flag`** - A Tauri plugin that wraps the flag client with caching and provides a `FlagPluginExt` trait. Each feature is defined in the `Feature` enum with a `FlagStrategy`: + - `Debug` - enabled only in debug builds + - `Posthog(key)` - evaluated via PostHog API with response caching + - `Hardcoded(bool)` - always returns the given value + +To check a flag from Rust: + +```rust +use hypr_plugin_flag::FlagPluginExt; + +let enabled = app.flag().is_enabled(Feature::Chat).await; +``` + +## Crate Architecture + +The analytics stack is split across several crates: + +- **`crates/posthog`** - Low-level PostHog HTTP client for sending events, setting properties, and identifying users. +- **`crates/analytics`** - Higher-level client that composes PostHog and Outlit clients via `AnalyticsClientBuilder`. Used by both the desktop app and the AI server. +- **`crates/flag`** - PostHog feature flag evaluation client (see above). + +## Server-Side Analytics + +The `apps/ai` server also reports analytics for proxy requests: + +- **LLM proxy** (`crates/llm-proxy`) - Reports `$ai_generation` events with model, token counts, latency, and cost. +- **STT proxy** (`crates/transcribe-proxy`) - Reports `$stt_request` events with provider and duration. + +Both proxies attribute events to users via device fingerprint and optional `user_id`. + ## How to make changes? See `.cursor/commands/add-analytics.md` for detailed instructions. diff --git a/apps/web/content/docs/faq/10.ai-models-and-privacy.mdx b/apps/web/content/docs/faq/10.ai-models-and-privacy.mdx index 05a2bdb425..4d348f1cc6 100644 --- a/apps/web/content/docs/faq/10.ai-models-and-privacy.mdx +++ b/apps/web/content/docs/faq/10.ai-models-and-privacy.mdx @@ -52,6 +52,8 @@ When cloud transcription is enabled, Hyprnote can use the following providers: **OpenAI** - Whisper API for transcription. [Privacy Policy](https://openai.com/policies/privacy-policy) +**ElevenLabs** - Speech-to-text with high accuracy. [Privacy Policy](https://elevenlabs.io/privacy-policy) + ## How is my data handled by cloud providers? When using cloud transcription, your audio is sent to the selected provider for processing. Each provider has different data retention and privacy policies: diff --git a/apps/web/content/docs/faq/3.technical.mdx b/apps/web/content/docs/faq/3.technical.mdx index 2138f90be2..dfce9fd683 100644 --- a/apps/web/content/docs/faq/3.technical.mdx +++ b/apps/web/content/docs/faq/3.technical.mdx @@ -6,7 +6,11 @@ description: "Technical requirements and specifications for Hyprnote." ## What are the system requirements? -Hyprnote requires macOS 12.0 or later with Apple Silicon (M1/M2/M3) or Intel processor. We recommend at least 8GB of RAM for optimal performance with local AI features. +**macOS**: macOS 12.0 or later with Apple Silicon (M1/M2/M3) or Intel processor. + +**Linux** (Experimental): x86_64 distributions with GTK and PulseAudio support. Available as AppImage or Debian package. See [Installation](/docs/getting-started/installation) for download links. + +We recommend at least 8GB of RAM for optimal performance with local AI features. ## How much storage space does Hyprnote need? diff --git a/apps/web/content/docs/faq/7.settings.mdx b/apps/web/content/docs/faq/7.settings.mdx index c2490989a0..f408046ffe 100644 --- a/apps/web/content/docs/faq/7.settings.mdx +++ b/apps/web/content/docs/faq/7.settings.mdx @@ -12,3 +12,7 @@ The settings file is located at: You can edit this file directly, but changes only take effect after restarting Hyprnote. For most settings, use the in-app Settings panel instead. +## Timezone + +You can manually configure your timezone in **Settings** > **General**. This controls how timestamps are displayed in the sidebar timeline and session metadata. By default, Hyprnote uses your system timezone. +