|
| 1 | +# JavaScript Logs Beta Configuration Fixes |
| 2 | + |
| 3 | +This document summarizes all the fixes made to JavaScript platform documentation to ensure that when users select the "Logs Beta" checkbox, the corresponding logs setup code appears in the getting started configuration. |
| 4 | + |
| 5 | +## Issue Fixed |
| 6 | + |
| 7 | +The user reported that when selecting the "Logs Beta" checkbox for JavaScript SDKs, they didn't see the logs snippet being added to the getting started code. This was because while the logs configuration was added to the shared platform-includes files, many individual JavaScript platform guides were missing: |
| 8 | + |
| 9 | +1. `'logs-beta'` in their OnboardingOptionButtons options arrays |
| 10 | +2. The logs configuration code with proper product option markers |
| 11 | + |
| 12 | +## Solution |
| 13 | + |
| 14 | +Added `'logs-beta'` to OnboardingOptionButtons and the corresponding logs configuration (`_experiments: { enableLogs: true }`) with product option markers to all JavaScript platform documentation files. |
| 15 | + |
| 16 | +## Files Updated |
| 17 | + |
| 18 | +### 1. JavaScript Framework Guides |
| 19 | + |
| 20 | +#### Vue.js |
| 21 | +- **File**: `docs/platforms/javascript/guides/vue/index.mdx` |
| 22 | +- **Changes**: |
| 23 | + - Added `'logs-beta'` to OnboardingOptionButtons |
| 24 | + - Added logs config to both Vue 3 and Vue 2 code blocks |
| 25 | +- **Configuration**: `_experiments: { enableLogs: true }` |
| 26 | + |
| 27 | +#### Svelte |
| 28 | +- **File**: `docs/platforms/javascript/guides/svelte/index.mdx` |
| 29 | +- **Changes**: |
| 30 | + - Added `'logs-beta'` to OnboardingOptionButtons |
| 31 | + - Added logs config to both Svelte v5+ and v3-v4 code blocks |
| 32 | +- **Configuration**: `_experiments: { enableLogs: true }` |
| 33 | + |
| 34 | +#### Astro |
| 35 | +- **File**: `docs/platforms/javascript/guides/astro/index.mdx` |
| 36 | +- **Changes**: |
| 37 | + - Added `'logs-beta'` to OnboardingOptionButtons |
| 38 | + - Added logs config to both client-side and server-side setup blocks |
| 39 | +- **Configuration**: `_experiments: { enableLogs: true }` |
| 40 | + |
| 41 | +#### Solid |
| 42 | +- **File**: `docs/platforms/javascript/guides/solid/index.mdx` |
| 43 | +- **Changes**: |
| 44 | + - Added `'logs-beta'` to OnboardingOptionButtons |
| 45 | + - Added logs config to the main configuration block |
| 46 | +- **Configuration**: `_experiments: { enableLogs: true }` |
| 47 | + |
| 48 | +#### Capacitor |
| 49 | +- **File**: `docs/platforms/javascript/guides/capacitor/index.mdx` |
| 50 | +- **Changes**: |
| 51 | + - Added `'logs-beta'` to OnboardingOptionButtons |
| 52 | + - Added logs config to all framework variations: |
| 53 | + - Angular 14+ |
| 54 | + - Angular 12-13 |
| 55 | + - React |
| 56 | + - Vue |
| 57 | + - Nuxt |
| 58 | +- **Configuration**: `_experiments: { enableLogs: true }` |
| 59 | + |
| 60 | +### 2. Main JavaScript Platform Documentation |
| 61 | + |
| 62 | +#### JavaScript Common |
| 63 | +- **File**: `docs/platforms/javascript/common/index.mdx` |
| 64 | +- **Changes**: Added `'logs-beta'` to all OnboardingOptionButtons instances: |
| 65 | + - Browser platforms: `["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]` |
| 66 | + - Server platforms (non-Bun): `["error-monitoring", "performance", "profiling", "logs-beta"]` |
| 67 | + - Bun platform: `["error-monitoring", "performance", "logs-beta"]` |
| 68 | + |
| 69 | +### 3. Previously Updated Files (Initial Implementation) |
| 70 | + |
| 71 | +These were already updated in the initial implementation: |
| 72 | +- `docs/platforms/javascript/guides/react/index.mdx` ✓ |
| 73 | +- `docs/platforms/javascript/guides/nextjs/manual-setup.mdx` ✓ |
| 74 | +- `platform-includes/getting-started-config/javascript.mdx` ✓ |
| 75 | + |
| 76 | +### 4. Platform-Includes Configuration Files (Fixed in Previous Session) |
| 77 | + |
| 78 | +These shared configuration files were updated to include the logs-beta configuration: |
| 79 | +- `platform-includes/getting-started-config/javascript.node.mdx` |
| 80 | +- `platform-includes/getting-started-config/javascript.aws-lambda.mdx` |
| 81 | +- `platform-includes/getting-started-config/javascript.gcp-functions.mdx` |
| 82 | +- `platform-includes/getting-started-config/javascript.cloudflare.workers.mdx` |
| 83 | +- `platform-includes/getting-started-config/javascript.nestjs.mdx` |
| 84 | + |
| 85 | +### 5. Framework Guides Using Shared Content |
| 86 | + |
| 87 | +These frameworks use shared content includes (getting-started-node) and inherit the logs configuration automatically: |
| 88 | +- Express (`docs/platforms/javascript/guides/express/index.mdx`) |
| 89 | +- Koa (`docs/platforms/javascript/guides/koa/index.mdx`) |
| 90 | +- Node.js (`docs/platforms/javascript/guides/node/index.mdx`) |
| 91 | + |
| 92 | +### 6. Wizard-Based Frameworks |
| 93 | + |
| 94 | +These frameworks use installation wizards and don't have OnboardingOptionButtons in their main docs: |
| 95 | +- Angular (`docs/platforms/javascript/guides/angular/index.mdx`) |
| 96 | +- Remix (`docs/platforms/javascript/guides/remix/index.mdx`) |
| 97 | +- Next.js (main guide - uses wizard) |
| 98 | + |
| 99 | +## JavaScript Configuration Pattern |
| 100 | + |
| 101 | +All JavaScript SDKs now use this consistent logs configuration: |
| 102 | + |
| 103 | +```javascript |
| 104 | +// ___PRODUCT_OPTION_START___ logs-beta |
| 105 | +// Enable logs to be sent to Sentry |
| 106 | +_experiments: { enableLogs: true }, |
| 107 | +// ___PRODUCT_OPTION_END___ logs-beta |
| 108 | +``` |
| 109 | + |
| 110 | +## Result |
| 111 | + |
| 112 | +Now when users select the "Logs Beta" checkbox in any JavaScript SDK documentation, they will see the appropriate logs configuration code appear in their setup instructions. This includes: |
| 113 | + |
| 114 | +✅ **Browser Frameworks**: React, Vue, Svelte, Solid, Angular (via Capacitor) |
| 115 | +✅ **Full-Stack Frameworks**: Astro, SvelteKit, Next.js, Nuxt, Remix |
| 116 | +✅ **Server Frameworks**: Node.js, Express, Koa, NestJS |
| 117 | +✅ **Runtime Environments**: Bun, Deno, Cloudflare Workers |
| 118 | +✅ **Serverless**: AWS Lambda, GCP Functions |
| 119 | +✅ **Mobile**: Capacitor (React, Vue, Angular variations) |
| 120 | + |
| 121 | +The logs snippet will properly show/hide based on the checkbox state, matching the behavior of other product options like performance monitoring and session replay. |
0 commit comments