feat(posthog): add generic configuration support to setup method#611
feat(posthog): add generic configuration support to setup method#611dwolfand wants to merge 2 commits into
Conversation
|
Please restore the pull request template and fill it out. |
Sorry about that, just updated it. |
| * Additional configuration options to pass to PostHog initialization. | ||
| * These will be merged with the default configuration. | ||
| * | ||
| * @since 8.0.0 |
There was a problem hiding this comment.
| * @since 8.0.0 | |
| * @since 7.3.0 |
| const config = { | ||
| api_host: host, | ||
| }); | ||
| ...(options.config || {}), |
There was a problem hiding this comment.
Move this line one up so that i cannot overwrite api_host.
| "peerDependencies": { | ||
| "@capacitor/core": ">=7.0.0", | ||
| "posthog-js": "^1.160.3" | ||
| "posthog-js": "^1.265.1" |
There was a problem hiding this comment.
Revert this change. Otherwise, we cannot merge it before the next major release since this would be a breaking change.
| "@ionic/swiftlint-config": "2.0.0", | ||
| "eslint": "8.57.0", | ||
| "posthog-js": "1.160.3", | ||
| "posthog-js": "1.265.1", |
There was a problem hiding this comment.
Revert this change. Otherwise, we cannot merge it before the next major release since this would be a breaking change.
| * @since 8.0.0 | ||
| * @example { 'autocapture': false, 'enable_recording_console_log': true } | ||
| */ | ||
| config?: Record<string, any>; |
There was a problem hiding this comment.
Move this property before host -> alphabetical order
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@capawesome/capacitor-posthog': patch | |||
There was a problem hiding this comment.
| '@capawesome/capacitor-posthog': patch | |
| '@capawesome/capacitor-posthog': minor |
| '@capawesome/capacitor-posthog': patch | ||
| --- | ||
|
|
||
| **feat: add generic configuration support to setup method**: Added optional `config` parameter to `SetupOptions` interface allowing developers to pass custom PostHog SDK configuration options during initialization. This enables fine-grained control over PostHog behavior such as `autocapture`, `enable_recording_console_log`, and other SDK-specific settings across all platforms (Web, Android, iOS). |
There was a problem hiding this comment.
| **feat: add generic configuration support to setup method**: Added optional `config` parameter to `SetupOptions` interface allowing developers to pass custom PostHog SDK configuration options during initialization. This enables fine-grained control over PostHog behavior such as `autocapture`, `enable_recording_console_log`, and other SDK-specific settings across all platforms (Web, Android, iOS). | |
| feat: add `config` option to `SetupOptions` |
|
if anyone needs this until its merged, I've rebased this PR onto main + did a release https://github.com/mirsella/capacitor-plugins/tree/posthog-config |
|
Closing due to inactivity |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run changeset).Overview
Adds optional
configparameter to the PostHog plugin'ssetup()method, enabling developers to pass custom PostHog SDK configuration options during initialization.Closes #610
Changes
config?: Record<string, any>parameter toSetupOptionsinterfaceposthog.init()PostHogAndroidConfigPostHogConfigposthog-jsdependency from1.160.3to1.265.1Usage Example
Testing
This enhancement provides developers with the flexibility to customize any PostHog SDK configuration option while maintaining full backward compatibility.