File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 11// lib/growthbook.ts
22import { GrowthBook } from '@growthbook/growthbook-react' ;
33
4- if ( ! process . env . NEXT_PUBLIC_GROWTHBOOK_API_HOST || ! process . env . NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY ) {
5- throw new Error ( 'NEXT_PUBLIC_GROWTHBOOK_API_HOST and NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY must be set' ) ;
6- }
7-
84export const growthbook = new GrowthBook ( {
9- apiHost : process . env . NEXT_PUBLIC_GROWTHBOOK_API_HOST ,
10- clientKey : process . env . NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY
5+ apiHost : process . env . NEXT_PUBLIC_GROWTHBOOK_API_HOST || '' ,
6+ clientKey : process . env . NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY || ''
117} ) ;
128
13- try {
9+ if ( process . env . NEXT_PUBLIC_GROWTHBOOK_API_HOST && process . env . NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY ) {
1410 growthbook . init ( ) ;
15- } catch ( error ) {
16- console . error ( 'Error initializing GrowthBook' , error ) ;
1711}
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ const config: DocsThemeConfig = {
134134 < script
135135 async
136136 src = 'https://widget.kapa.ai/kapa-widget.bundle.js'
137- data-website-id = { process . env . NEXT_PUBLIC_KAPA_WEBSITE_ID }
137+ data-website-id = { process . env . NEXT_PUBLIC_KAPA_WEBSITE_ID || '' }
138138 data-project-name = 'OP Labs'
139139 data-project-color = '#FF0420'
140140 data-modal-title = 'Optimism Docs Assistant ✨'
You can’t perform that action at this time.
0 commit comments