@posthog/wizard 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,6 @@ const getOutroMessage = ({ options, integration, cloudRegion, addedEditorRules,
40
40
  uploadedEnvVars.length === 0
41
41
  ? `Upload your Project API key to your hosting provider`
42
42
  : '',
43
- `Create a PR for your changes`,
44
43
  ].filter(Boolean);
45
44
  return `
46
45
  ${chalk_1.default.green('Successfully installed PostHog!')}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/lib/messages.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,wCAAsD;AAEtD,2CAAsD;AACtD,qCAA8C;AAEvC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,WAAW,EACX,gBAAgB,GAIjB,EAAE,EAAE;IACH,MAAM,iBAAiB,GAAG,2BAAkB,CAAC,WAAW,CAAC,CAAC;IAE1D,OAAO;;;IAGL,iBAAiB,CAAC,cAAc;IAChC,gBAAgB,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,EAAE;;;wBAI5D,iBAAiB,CAAC,IACpB;;+BAE6B,iBAAiB,CAAC,IAAI,KACjD,iBAAiB,CAAC,OACpB,EAAE,CAAC;AACL,CAAC,CAAC;AAvBW,QAAA,gBAAgB,oBAuB3B;AAEK,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,EACP,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,GAShB,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;QAChC,CAAC,CAAC,GAAG,IAAA,4BAAqB,EAAC,WAAW,CAAC,yBAAyB;QAChE,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,iBAAiB,GAAG,2BAAkB,CAAC,WAAW,CAAC,CAAC;IAE1D,MAAM,OAAO,GAAG;QACd,gBAAgB,CAAC,C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,CAAC;AAC9E,CAAC,CAAC;AAhEW,QAAA,eAAe,mBAgE1B","sourcesContent":["import chalk from 'chalk';\nimport type { CloudRegion, WizardOptions } from '../utils/types';\nimport { getCloudUrlFromRegion } from '../utils/urls';\nimport type { PackageManager } from '../utils/package-manager';\nimport { ISSUES_URL, Integration } from './constants';\nimport { INTEGRATION_CONFIG } from './config';\n\nexport const getPRDescription = ({\n integration,\n addedEditorRules,\n}: {\n integration: Integration;\n addedEditorRules: boolean;\n}) => {\n const integrationConfig = INTEGRATION_CONFIG[integration];\n\n return `This PR adds an integration for PostHog.\n\n The following changes were made:\n ${integrationConfig.defaultChanges}\n ${addedEditorRules ? `• Added Cursor rules for PostHog\\n` : ''}\n \n \n Note: This used the ${\n integrationConfig.name\n } wizard to setup PostHog, this is still in alpha and like all AI, might have got it wrong. Please check the installation carefully!\n \n Learn more about PostHog + ${integrationConfig.name}: ${\n integrationConfig.docsUrl\n }`;\n};\n\nexport const getOutroMessage = ({\n options,\n integration,\n cloudRegion,\n addedEditorRules,\n packageManager,\n envFileChanged,\n uploadedEnvVars,\n}: {\n options: WizardOptions;\n integration: Integration;\n cloudRegion: CloudRegion;\n addedEditorRules: boolean;\n packageManager?: PackageManager;\n envFileChanged?: string;\n uploadedEnvVars: string[];\n}) => {\n const continueUrl = options.signup\n ? `${getCloudUrlFromRegion(cloudRegion)}/products?source=wizard`\n : undefined;\n\n const integrationConfig = INTEGRATION_CONFIG[integration];\n\n const changes = [\n addedEditorRules ? `Added Cursor rules for PostHog` : '',\n envFileChanged\n ? `Added your Project API key to your ${envFileChanged} file`\n : '',\n uploadedEnvVars.length > 0\n ? `Uploaded your Project API key to your hosting provider`\n : '',\n ].filter(Boolean);\n\n const nextSteps = [\n uploadedEnvVars.length === 0\n ? `Upload your Project API key to your hosting provider`\n : '',\n `Create a PR for your changes`,\n ].filter(Boolean);\n\n return `\n${chalk.green('Successfully installed PostHog!')} \n \n${chalk.cyan('Changes made:')}\n${integrationConfig.defaultChanges}\n${changes.map((change) => `• ${change}`).join('\\n')}\n\n${chalk.yellow('Next steps:')}\n${integrationConfig.nextSteps}\n${nextSteps.map((step) => `• ${step}`).join('\\n')}\n\nLearn more about PostHog + ${integrationConfig.name}: ${chalk.cyan(\n integrationConfig.docsUrl,\n )}\n${continueUrl ? `\\nContinue onboarding: ${chalk.cyan(continueUrl)}\\n` : ``}\nNote: This uses experimental AI to setup your project. It might have got it wrong, please check!\n\nYou should validate your setup by (re)starting your dev environment${\n packageManager\n ? ` (e.g. ${chalk.cyan(`${packageManager.runScriptCommand} dev`)}).`\n : `.`\n }\n\n${chalk.dim(`If you encounter any issues, let us know here: ${ISSUES_URL}`)}`;\n};\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/lib/messages.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,wCAAsD;AAEtD,2CAAsD;AACtD,qCAA8C;AAEvC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,WAAW,EACX,gBAAgB,GAIjB,EAAE,EAAE;IACH,MAAM,iBAAiB,GAAG,2BAAkB,CAAC,WAAW,CAAC,CAAC;IAE1D,OAAO;;;IAGL,iBAAiB,CAAC,cAAc;IAChC,gBAAgB,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,EAAE;;;wBAI5D,iBAAiB,CAAC,IACpB;;+BAE6B,iBAAiB,CAAC,IAAI,KACjD,iBAAiB,CAAC,OACpB,EAAE,CAAC;AACL,CAAC,CAAC;AAvBW,QAAA,gBAAgB,oBAuB3B;AAEK,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,EACP,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,GAShB,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;QAChC,CAAC,CAAC,GAAG,IAAA,4BAAqB,EAAC,WAAW,CAAC,yBAAyB;QAChE,CAAC,CAAC,SAAS,CAAC;IAEd,MAA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AAC,CAAC,GACN;;EAEA,eAAK,CAAC,GAAG,CAAC,kDAAkD,sBAAU,EAAE,CAAC,EAAE,CAAC;AAC9E,CAAC,CAAC;AA/DW,QAAA,eAAe,mBA+D1B","sourcesContent":["import chalk from 'chalk';\nimport type { CloudRegion, WizardOptions } from '../utils/types';\nimport { getCloudUrlFromRegion } from '../utils/urls';\nimport type { PackageManager } from '../utils/package-manager';\nimport { ISSUES_URL, Integration } from './constants';\nimport { INTEGRATION_CONFIG } from './config';\n\nexport const getPRDescription = ({\n integration,\n addedEditorRules,\n}: {\n integration: Integration;\n addedEditorRules: boolean;\n}) => {\n const integrationConfig = INTEGRATION_CONFIG[integration];\n\n return `This PR adds an integration for PostHog.\n\n The following changes were made:\n ${integrationConfig.defaultChanges}\n ${addedEditorRules ? `• Added Cursor rules for PostHog\\n` : ''}\n \n \n Note: This used the ${\n integrationConfig.name\n } wizard to setup PostHog, this is still in alpha and like all AI, might have got it wrong. Please check the installation carefully!\n \n Learn more about PostHog + ${integrationConfig.name}: ${\n integrationConfig.docsUrl\n }`;\n};\n\nexport const getOutroMessage = ({\n options,\n integration,\n cloudRegion,\n addedEditorRules,\n packageManager,\n envFileChanged,\n uploadedEnvVars,\n}: {\n options: WizardOptions;\n integration: Integration;\n cloudRegion: CloudRegion;\n addedEditorRules: boolean;\n packageManager?: PackageManager;\n envFileChanged?: string;\n uploadedEnvVars: string[];\n}) => {\n const continueUrl = options.signup\n ? `${getCloudUrlFromRegion(cloudRegion)}/products?source=wizard`\n : undefined;\n\n const integrationConfig = INTEGRATION_CONFIG[integration];\n\n const changes = [\n addedEditorRules ? `Added Cursor rules for PostHog` : '',\n envFileChanged\n ? `Added your Project API key to your ${envFileChanged} file`\n : '',\n uploadedEnvVars.length > 0\n ? `Uploaded your Project API key to your hosting provider`\n : '',\n ].filter(Boolean);\n\n const nextSteps = [\n uploadedEnvVars.length === 0\n ? `Upload your Project API key to your hosting provider`\n : '',\n ].filter(Boolean);\n\n return `\n${chalk.green('Successfully installed PostHog!')} \n \n${chalk.cyan('Changes made:')}\n${integrationConfig.defaultChanges}\n${changes.map((change) => `• ${change}`).join('\\n')}\n\n${chalk.yellow('Next steps:')}\n${integrationConfig.nextSteps}\n${nextSteps.map((step) => `• ${step}`).join('\\n')}\n\nLearn more about PostHog + ${integrationConfig.name}: ${chalk.cyan(\n integrationConfig.docsUrl,\n )}\n${continueUrl ? `\\nContinue onboarding: ${chalk.cyan(continueUrl)}\\n` : ``}\nNote: This uses experimental AI to setup your project. It might have got it wrong, please check!\n\nYou should validate your setup by (re)starting your dev environment${\n packageManager\n ? ` (e.g. ${chalk.cyan(`${packageManager.runScriptCommand} dev`)}).`\n : `.`\n }\n\n${chalk.dim(`If you encounter any issues, let us know here: ${ISSUES_URL}`)}`;\n};\n"]}
@@ -10,6 +10,7 @@ LOCATION: Wherever other providers are, or the components folder
10
10
  ==============================
11
11
  Changes:
12
12
  - Create a PostHogProvider component that will be imported into the layout file.
13
+ - Make sure to include the defaults: '2025-05-24' option in the init call.
13
14
 
14
15
  Example:
15
16
  --------------------------------------------------
@@ -133,6 +134,7 @@ LOCATION: Wherever the root _app.${language === 'typescript' ? 'tsx' : 'jsx'} fi
133
134
  Changes:
134
135
  - Initialize PostHog in _app.js.
135
136
  - Wrap the application in PostHogProvider.
137
+ - Make sure to include the defaults: '2025-05-24' option in the init call.
136
138
 
137
139
  Example:
138
140
  --------------------------------------------------
@@ -227,6 +229,7 @@ Changes:
227
229
  - Create or update the instrumentation-client.${language === 'typescript' ? 'ts' : 'js'} file to use the PostHog client. If the file does not exist yet, create it.
228
230
  - Do *not* import instrumentation-client.${language === 'typescript' ? 'ts' : 'js'} in any other file; Next.js will automatically handle it.
229
231
  - Do not modify any other pages/components in the Next.js application; the PostHog client will be automatically initialized and handle all pageview tasks on its own.
232
+ - Make sure to include the defaults: '2025-05-24' option in the init call.
230
233
 
231
234
  Example:
232
235
  --------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRo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,CAAC;AAnGW,QAAA,wBAAwB,4BAmGnC;AAEK,MAAM,mBAAmB,GAAG,CAAC,EAClC,IAAI,EACJ,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO;;+BAEsB,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;gDAKlE,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IACrC;2CAEE,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IACrC;;;;;;;;;;cAUY,IAAA,wBAAiB,EAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;wBAwBb,IAAA,2BAAoB,EAAC,IAAI,CAAC;;;;wBAI1B,IAAI;;;;wBAIJ,IAAI;;;;;;;;mDAQuB,CAAC;AACpD,CAAC,CAAC;AArEW,QAAA,mBAAmB,uBAqE9B","sourcesContent":["import { getAssetHostFromHost, getUiHostFromHost } from '../utils/urls';\n\nexport const getNextjsAppRouterDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: PostHogProvider.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } (put it somewhere where client files are, like the components folder)\nLOCATION: Wherever other providers are, or the components folder\n==============================\nChanges:\n- Create a PostHogProvider component that will be imported into the layout file.\n\nExample:\n--------------------------------------------------\n\"use client\"\n\nimport posthog from \"posthog-js\"\nimport { PostHogProvider as PHProvider, usePostHog } from \"posthog-js/react\"\nimport { Suspense, useEffect } from \"react\"\nimport { usePathname, useSearchParams } from \"next/navigation\"\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return (\n <PHProvider client={posthog}>\n {children}\n </PHProvider>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: layout.${language === 'typescript' ? 'tsx' : 'jsx'}\nLOCATION: Wherever the root layout is\n==============================\nChanges:\n- Import the PostHogProvider from the providers file and wrap the app in it.\n\nExample:\n--------------------------------------------------\n// other imports\nimport { PostHogProvider } from \"LOCATION_OF_POSTHOG_PROVIDER\"\n\nexport default function RootLayout({ children }) {\n return (\n <html lang=\"en\">\n <body>\n <PostHogProvider>\n {/* other providers */}\n {children}\n {/* other providers */}\n </PostHogProvider>\n </body>\n </html>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: posthog.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: Wherever works best given the project structure\n==============================\nChanges:\n- Initialize the PostHog Node.js client\n\nExample:\n--------------------------------------------------\nimport { PostHog } from \"posthog-node\"\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n })\n return posthogClient\n}\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n\nexport const getNextjsPagesRouterDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: _app.${language === 'typescript' ? 'tsx' : 'jsx'}\nLOCATION: Wherever the root _app.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } file is\n==============================\nChanges:\n- Initialize PostHog in _app.js.\n- Wrap the application in PostHogProvider.\n\nExample:\n--------------------------------------------------\nimport { useEffect } from \"react\"\nimport posthog from \"posthog-js\"\nimport { PostHogProvider } from \"posthog-js/react\"\n\nexport default function App({ Component, pageProps }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return (\n <PostHogProvider client={posthog}>\n <Component {...pageProps} />\n </PostHogProvider>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: posthog.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: Wherever works best given the project structure\n==============================\nChanges:\n- Initialize the PostHog Node.js client\n\nExample:\n--------------------------------------------------\nimport { PostHog } from \"posthog-node\"\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n })\n return posthogClient\n}\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n\nexport const getModernNextjsDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: instrumentation-client.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: in the root of the application or inside an src folder.\n==============================\nChanges:\n- Create or update the instrumentation-client.${\n language === 'typescript' ? 'ts' : 'js'\n } file to use the PostHog client. If the file does not exist yet, create it.\n- Do *not* import instrumentation-client.${\n language === 'typescript' ? 'ts' : 'js'\n } in any other file; Next.js will automatically handle it.\n- Do not modify any other pages/components in the Next.js application; the PostHog client will be automatically initialized and handle all pageview tasks on its own.\n\nExample:\n--------------------------------------------------\n\nimport posthog from \"posthog-js\"\n\nposthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n});\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n"]}
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../src/nextjs/docs.ts"],"names":[],"mappings":";;;AAAA,wCAAwE;AAEjE,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO;;wBAGL,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KACtC;;;;;;;;;;;;;;;;;;;;kBAoBgB,IAAA,wBAAiB,EAAC,IAAI,CAAC;;;;;;;;;;;;;;;;eAgB1B,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2BxC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsC/B,IAAA,2BAAoB,EAAC,IAAI,CAAC;;;;wBAI1B,IAAI;;;;wBAIJ,IAAI;;;;;;;;mDAQuB,CAAC;AACpD,CAAC,CAAC;AAjIW,QAAA,sBAAsB,0BAiIjC;AAEK,MAAM,wBAAwB,GAAG,CAAC,EACvC,IAAI,EACJ,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO;;aAEI,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;mCAElD,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KACtC;;;;;;;;;;;;;;;;;kBAiBgB,IAAA,wBAAiB,EAAC,IAAI,CAAC;;;;;;;;;;;;;;;;gBAgBzB,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsC/B,IAAA,2BAAoB,EAAC,IAAI,CAAC;;;;wBAI1B,IAAI;;;;wBAIJ,IAAI;;;;;;;;mDAQuB,CAAC;AACpD,CAAC,CAAC;AApGW,QAAA,wBAAwB,4BAoGnC;AAEK,MAAM,mBAAmB,GAAG,CAAC,EAClC,IAAI,EACJ,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO;;+BAEsB,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;gDAKlE,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IACrC;2CAEE,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IACrC;;;;;;;;;;;cAWY,IAAA,wBAAiB,EAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;wBAwBb,IAAA,2BAAoB,EAAC,IAAI,CAAC;;;;wBAI1B,IAAI;;;;wBAIJ,IAAI;;;;;;;;mDAQuB,CAAC;AACpD,CAAC,CAAC;AAtEW,QAAA,mBAAmB,uBAsE9B","sourcesContent":["import { getAssetHostFromHost, getUiHostFromHost } from '../utils/urls';\n\nexport const getNextjsAppRouterDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: PostHogProvider.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } (put it somewhere where client files are, like the components folder)\nLOCATION: Wherever other providers are, or the components folder\n==============================\nChanges:\n- Create a PostHogProvider component that will be imported into the layout file.\n- Make sure to include the defaults: '2025-05-24' option in the init call.\n\nExample:\n--------------------------------------------------\n\"use client\"\n\nimport posthog from \"posthog-js\"\nimport { PostHogProvider as PHProvider, usePostHog } from \"posthog-js/react\"\nimport { Suspense, useEffect } from \"react\"\nimport { usePathname, useSearchParams } from \"next/navigation\"\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return (\n <PHProvider client={posthog}>\n {children}\n </PHProvider>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: layout.${language === 'typescript' ? 'tsx' : 'jsx'}\nLOCATION: Wherever the root layout is\n==============================\nChanges:\n- Import the PostHogProvider from the providers file and wrap the app in it.\n\nExample:\n--------------------------------------------------\n// other imports\nimport { PostHogProvider } from \"LOCATION_OF_POSTHOG_PROVIDER\"\n\nexport default function RootLayout({ children }) {\n return (\n <html lang=\"en\">\n <body>\n <PostHogProvider>\n {/* other providers */}\n {children}\n {/* other providers */}\n </PostHogProvider>\n </body>\n </html>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: posthog.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: Wherever works best given the project structure\n==============================\nChanges:\n- Initialize the PostHog Node.js client\n\nExample:\n--------------------------------------------------\nimport { PostHog } from \"posthog-node\"\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n })\n return posthogClient\n}\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n\nexport const getNextjsPagesRouterDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: _app.${language === 'typescript' ? 'tsx' : 'jsx'}\nLOCATION: Wherever the root _app.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } file is\n==============================\nChanges:\n- Initialize PostHog in _app.js.\n- Wrap the application in PostHogProvider.\n- Make sure to include the defaults: '2025-05-24' option in the init call.\n\nExample:\n--------------------------------------------------\nimport { useEffect } from \"react\"\nimport posthog from \"posthog-js\"\nimport { PostHogProvider } from \"posthog-js/react\"\n\nexport default function App({ Component, pageProps }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return (\n <PostHogProvider client={posthog}>\n <Component {...pageProps} />\n </PostHogProvider>\n )\n}\n--------------------------------------------------\n\n==============================\nFILE: posthog.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: Wherever works best given the project structure\n==============================\nChanges:\n- Initialize the PostHog Node.js client\n\nExample:\n--------------------------------------------------\nimport { PostHog } from \"posthog-node\"\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n })\n return posthogClient\n}\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n\nexport const getModernNextjsDocs = ({\n host,\n language,\n}: {\n host: string;\n language: 'typescript' | 'javascript';\n}) => {\n return `\n==============================\nFILE: instrumentation-client.${language === 'typescript' ? 'ts' : 'js'}\nLOCATION: in the root of the application or inside an src folder.\n==============================\nChanges:\n- Create or update the instrumentation-client.${\n language === 'typescript' ? 'ts' : 'js'\n } file to use the PostHog client. If the file does not exist yet, create it.\n- Do *not* import instrumentation-client.${\n language === 'typescript' ? 'ts' : 'js'\n } in any other file; Next.js will automatically handle it.\n- Do not modify any other pages/components in the Next.js application; the PostHog client will be automatically initialized and handle all pageview tasks on its own.\n- Make sure to include the defaults: '2025-05-24' option in the init call.\n\nExample:\n--------------------------------------------------\n\nimport posthog from \"posthog-js\"\n\nposthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: \"/ingest\",\n ui_host: \"${getUiHostFromHost(host)}\",\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: process.env.NODE_ENV === \"development\",\n});\n--------------------------------------------------\n\n==============================\nFILE: next.config.{js,ts,mjs,cjs}\nLOCATION: Wherever the root next config is\n==============================\nChanges:\n- Add rewrites to the Next.js config to support PostHog, if there are existing rewrites, add the PostHog rewrites to them.\n- Add skipTrailingSlashRedirect to the Next.js config to support PostHog trailing slash API requests.\n- This can be of type js, ts, mjs, cjs etc. You should adapt the file according to what extension it uses, and if it does not exist yet use '.js'.\n\nExample:\n--------------------------------------------------\nconst nextConfig = {\n // other config\n async rewrites() {\n return [\n {\n source: \"/ingest/static/:path*\",\n destination: \"${getAssetHostFromHost(host)}/static/:path*\",\n },\n {\n source: \"/ingest/:path*\",\n destination: \"${host}/:path*\",\n },\n {\n source: \"/ingest/decide\",\n destination: \"${host}/decide\",\n },\n ];\n },\n // This is required to support PostHog trailing slash API requests\n skipTrailingSlashRedirect: true,\n}\nmodule.exports = nextConfig\n--------------------------------------------------`;\n};\n"]}
@@ -15,6 +15,7 @@ LOCATION: Wherever the root of the app is
15
15
  ==============================
16
16
  Changes:
17
17
  - Add the PostHogProvider to the root of the app in the provider tree.
18
+ - Make sure to include the defaults: '2025-05-24' option in the init call.
18
19
 
19
20
  Example:
20
21
  --------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../src/react/docs.ts"],"names":[],"mappings":";;;AAAO,MAAM,qBAAqB,GAAG,CAAC,EACpC,QAAQ,EACR,YAAY,GAIb,EAAE,EAAE;IACH,MAAM,UAAU,GACd,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,yCAAyC;QAC3C,CAAC,CAAC,eAAe,YAAY,aAAa,CAAC;IAE/C,MAAM,QAAQ,GACZ,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,0CAA0C;QAC5C,CAAC,CAAC,eAAe,YAAY,cAAc,CAAC;IAEhD,OAAO;;sBAGL,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KACtC;;;;;;;;;;;;;;;;;;;gBAmBc,UAAU;;oBAEN,QAAQ;;;iBAIlB,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,wCACN;;;;;;mDAM2C,CAAC;AACpD,CAAC,CAAC;AAxDW,QAAA,qBAAqB,yBAwDhC","sourcesContent":["export const getReactDocumentation = ({\n language,\n envVarPrefix,\n}: {\n language: 'typescript' | 'javascript';\n envVarPrefix: string;\n}) => {\n const apiKeyText =\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.VITE_PUBLIC_POSTHOG_KEY'\n : `process.env.${envVarPrefix}POSTHOG_KEY`;\n\n const hostText =\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.VITE_PUBLIC_POSTHOG_HOST'\n : `process.env.${envVarPrefix}POSTHOG_HOST`;\n\n return `\n==============================\nFILE: {index / App}.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } (wherever the root of the app is)\nLOCATION: Wherever the root of the app is\n==============================\nChanges:\n- Add the PostHogProvider to the root of the app in the provider tree.\n\nExample:\n--------------------------------------------------\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\n\nimport { PostHogProvider} from 'posthog-js/react'\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\n\nroot.render(\n <React.StrictMode>\n <PostHogProvider\n apiKey={${apiKeyText}}\n options={{\n api_host: ${hostText},\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: ${\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.MODE === \"development\"'\n : 'process.env.NODE_ENV === \"development\"'\n },\n }}\n >\n <App />\n </PostHogProvider>\n </React.StrictMode>\n--------------------------------------------------`;\n};\n"]}
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../src/react/docs.ts"],"names":[],"mappings":";;;AAAO,MAAM,qBAAqB,GAAG,CAAC,EACpC,QAAQ,EACR,YAAY,GAIb,EAAE,EAAE;IACH,MAAM,UAAU,GACd,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,yCAAyC;QAC3C,CAAC,CAAC,eAAe,YAAY,aAAa,CAAC;IAE/C,MAAM,QAAQ,GACZ,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,0CAA0C;QAC5C,CAAC,CAAC,eAAe,YAAY,cAAc,CAAC;IAEhD,OAAO;;sBAGL,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KACtC;;;;;;;;;;;;;;;;;;;;gBAoBc,UAAU;;oBAEN,QAAQ;;;iBAIlB,YAAY,KAAK,cAAc;QAC7B,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,wCACN;;;;;;mDAM2C,CAAC;AACpD,CAAC,CAAC;AAzDW,QAAA,qBAAqB,yBAyDhC","sourcesContent":["export const getReactDocumentation = ({\n language,\n envVarPrefix,\n}: {\n language: 'typescript' | 'javascript';\n envVarPrefix: string;\n}) => {\n const apiKeyText =\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.VITE_PUBLIC_POSTHOG_KEY'\n : `process.env.${envVarPrefix}POSTHOG_KEY`;\n\n const hostText =\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.VITE_PUBLIC_POSTHOG_HOST'\n : `process.env.${envVarPrefix}POSTHOG_HOST`;\n\n return `\n==============================\nFILE: {index / App}.${\n language === 'typescript' ? 'tsx' : 'jsx'\n } (wherever the root of the app is)\nLOCATION: Wherever the root of the app is\n==============================\nChanges:\n- Add the PostHogProvider to the root of the app in the provider tree.\n- Make sure to include the defaults: '2025-05-24' option in the init call.\n\nExample:\n--------------------------------------------------\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\n\nimport { PostHogProvider} from 'posthog-js/react'\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\n\nroot.render(\n <React.StrictMode>\n <PostHogProvider\n apiKey={${apiKeyText}}\n options={{\n api_host: ${hostText},\n defaults: '2025-05-24',\n capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this\n debug: ${\n envVarPrefix === 'VITE_PUBLIC_'\n ? 'import.meta.env.MODE === \"development\"'\n : 'process.env.NODE_ENV === \"development\"'\n },\n }}\n >\n <App />\n </PostHogProvider>\n </React.StrictMode>\n--------------------------------------------------`;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/wizard",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "homepage": "https://github.com/posthog/wizard",
5
5
  "repository": "https://github.com/posthog/wizard",
6
6
  "description": "The PostHog wizard helps you to configure your project",