diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index bd3e4ee..02e2bbe 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "posthog", "description": "Access PostHog analytics, feature flags, experiments, error tracking, and insights directly from Claude Code. Optionally capture Claude Code sessions to PostHog LLM Analytics.", - "version": "1.1.27", + "version": "1.1.28", "author": { "name": "PostHog", "email": "hey@posthog.com", diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index b0721b0..a534129 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "posthog", - "version": "1.0.25", + "version": "1.0.26", "description": "Access PostHog analytics, feature flags, experiments, error tracking, and insights directly from Codex", "author": { "name": "PostHog", diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index 0d9ede6..dceb2c3 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "posthog", "displayName": "PostHog", - "version": "1.1.22", + "version": "1.1.23", "description": "Access PostHog analytics, feature flags, experiments, error tracking, and insights directly from Cursor", "author": { "name": "PostHog", diff --git a/gemini-extension.json b/gemini-extension.json index 29c35d7..bc617d0 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "posthog", - "version": "1.0.24", + "version": "1.0.25", "description": "Access PostHog analytics, feature flags, experiments, error tracking, and insights directly from Gemini CLI", "mcpServers": { "posthog": { diff --git a/skills/instrument-integration/references/android.md b/skills/instrument-integration/references/android.md index 624da8a..0698f4b 100644 --- a/skills/instrument-integration/references/android.md +++ b/skills/instrument-integration/references/android.md @@ -387,9 +387,9 @@ PostHog.isOptOut() ## Flush -You can set the number of events in the configuration that should queue before flushing. Setting this to `1` will send events immediately and will use more battery. The default value for this is `20`. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -You can also configure the flush interval. By default we flush all events after `30` seconds, no matter how many events have been gathered. +You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered: Kotlin @@ -403,7 +403,7 @@ val config = PostHogAndroidConfig(apiKey = POSTHOG_API_KEY, host = POSTHOG_HOST) } ``` -You can also manually flush the queue: +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: Kotlin @@ -414,6 +414,8 @@ import com.posthog.PostHog PostHog.flush() ``` +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Reset after logout To reset the user's ID and anonymous ID, call `reset`. Usually you would do this right after the user logs out. diff --git a/skills/instrument-integration/references/configuration.md b/skills/instrument-integration/references/configuration.md index f43493b..427f3f3 100644 --- a/skills/instrument-integration/references/configuration.md +++ b/skills/instrument-integration/references/configuration.md @@ -8,9 +8,9 @@ You can enable or disable autocapture through the `PostHogConfig` object. The iOS SDK uses an internal queue to make calls fast and non-blocking. It also batches requests and flushes asynchronously, making it perfect to use in any part of your mobile app. -You can set the number of events in the configuration that should queue before flushing. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -Setting this to `1` will send events immediately and will use more battery. This is set to `20` by default. +You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered: Swift @@ -18,9 +18,10 @@ PostHog AI ```swift configuration.flushAt = 1 +configuration.flushIntervalSeconds = 30 ``` -You can also manually flush the queue: +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: Swift @@ -31,6 +32,8 @@ PostHogSDK.shared.capture("logged_out") PostHogSDK.shared.flush() ``` +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Amending, dropping or sampling events Since version 3.28.0, you can provide a `BeforeSendBlock` function when initializing the SDK to amend, drop or sample events before they are sent to PostHog. diff --git a/skills/instrument-integration/references/flutter.md b/skills/instrument-integration/references/flutter.md index 4a65c7c..16b5375 100644 --- a/skills/instrument-integration/references/flutter.md +++ b/skills/instrument-integration/references/flutter.md @@ -623,6 +623,34 @@ If you're using Flutter Web, also enable the [Canvas capture](/docs/session-repl [Surveys](/docs/surveys.md) launched with [popover presentation](/docs/surveys/creating-surveys.md#presentation) are automatically shown to users matching the [display conditions](/docs/surveys/creating-surveys.md#display-conditions) you set up. +## Flush + +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. + +You can also configure the flush interval with `flushInterval` (default 30 seconds), after which queued events are sent regardless of how many have been gathered: + +Dart + +PostHog AI + +```dart +final config = PostHogConfig(''); +config.flushAt = 20; +config.flushInterval = const Duration(seconds: 30); +``` + +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: + +Dart + +PostHog AI + +```dart +await Posthog().flush(); +``` + +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Offline behavior The PostHog Flutter SDK will continue to capture events when the device is offline for Android and Apple platforms. The events are stored in a queue in the device's file storage and are flushed when the device is online. diff --git a/skills/instrument-integration/references/posthog-js.md b/skills/instrument-integration/references/posthog-js.md index a958ff4..f00b32c 100644 --- a/skills/instrument-integration/references/posthog-js.md +++ b/skills/instrument-integration/references/posthog-js.md @@ -1,6 +1,6 @@ # PostHog JavaScript Web SDK -**SDK Version:** 1.376.6 +**SDK Version:** 1.378.1 Posthog-js allows you to automatically capture usage and send events to PostHog. diff --git a/skills/instrument-integration/references/posthog-node.md b/skills/instrument-integration/references/posthog-node.md index 25e021e..88ed2c9 100644 --- a/skills/instrument-integration/references/posthog-node.md +++ b/skills/instrument-integration/references/posthog-node.md @@ -1,6 +1,6 @@ # PostHog Node.js SDK -**SDK Version:** 5.35.8 +**SDK Version:** 5.35.11 PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications. diff --git a/skills/instrument-integration/references/posthog-python.md b/skills/instrument-integration/references/posthog-python.md index be9a6b8..455961c 100644 --- a/skills/instrument-integration/references/posthog-python.md +++ b/skills/instrument-integration/references/posthog-python.md @@ -1,6 +1,6 @@ # PostHog Python SDK -**SDK Version:** 7.16.2 +**SDK Version:** 7.16.3 Integrate PostHog into any python application. diff --git a/skills/instrument-integration/references/react-native.md b/skills/instrument-integration/references/react-native.md index 0671bb3..6328a6d 100644 --- a/skills/instrument-integration/references/react-native.md +++ b/skills/instrument-integration/references/react-native.md @@ -618,11 +618,22 @@ posthog.has_opted_out_capturing() ## Flush -You can set the number of events in the configuration that should queue before flushing. Setting this to `1` will send events immediately and will use more battery. This is set to `20` by default. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -You can also configure the flush interval. By default we flush all events after `30` seconds, no matter how many events have gathered. +You can also configure the flush interval with `flushInterval`, in milliseconds (default `10000`), after which queued events are sent regardless of how many have been gathered: -You can also manually flush the queue. If a flush is already in progress it returns a promise for the existing flush. +JavaScript + +PostHog AI + +```javascript +const posthog = new PostHog('', { + flushAt: 20, + flushInterval: 10000, +}) +``` + +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: JavaScript @@ -632,6 +643,10 @@ PostHog AI await posthog.flush() ``` +If a flush is already in progress, it returns a promise for the existing flush. + +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Reset after logout To reset the user's ID and anonymous ID, call `reset`. Usually you would do this right after the user logs out. diff --git a/skills/instrument-logs/references/debug-logs-mcp.md b/skills/instrument-logs/references/debug-logs-mcp.md index 5412ef0..175657c 100644 --- a/skills/instrument-logs/references/debug-logs-mcp.md +++ b/skills/instrument-logs/references/debug-logs-mcp.md @@ -23,19 +23,21 @@ Try these prompts with your MCP-enabled agent: ## Logs tools -The MCP server provides three tools for working with logs: +The MCP server provides four tools for working with logs: | Tool | Description | | --- | --- | | logs-query | Search and query logs with filters for severity levels (trace, debug, info, warn, error, fatal), service names, date ranges, and free text. Supports pagination for large result sets. | | logs-list-attributes | List available log attributes in your project to discover what you can filter on. Supports filtering by attribute type (log or resource). | | logs-list-attribute-values | Get possible values for a specific log attribute. Find service names, log levels, or other attribute values before querying. | +| logs-count | Get a count of logs matching your filters. Use as a pre-flight check before logs-query – if the count exceeds 1,000 (the maximum limit), narrow your filters or shorten the date range first. | A typical workflow: 1. Call `logs-list-attributes` to discover available filter attributes. 2. Call `logs-list-attribute-values` to find specific values (e.g., which service names exist). -3. Call `logs-query` to search logs with the right filters. +3. Call `logs-count` to check how many logs match your filters before querying. +4. Call `logs-query` to search logs with the right filters. ## Get started diff --git a/skills/instrument-product-analytics/references/android.md b/skills/instrument-product-analytics/references/android.md index 624da8a..0698f4b 100644 --- a/skills/instrument-product-analytics/references/android.md +++ b/skills/instrument-product-analytics/references/android.md @@ -387,9 +387,9 @@ PostHog.isOptOut() ## Flush -You can set the number of events in the configuration that should queue before flushing. Setting this to `1` will send events immediately and will use more battery. The default value for this is `20`. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -You can also configure the flush interval. By default we flush all events after `30` seconds, no matter how many events have been gathered. +You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered: Kotlin @@ -403,7 +403,7 @@ val config = PostHogAndroidConfig(apiKey = POSTHOG_API_KEY, host = POSTHOG_HOST) } ``` -You can also manually flush the queue: +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: Kotlin @@ -414,6 +414,8 @@ import com.posthog.PostHog PostHog.flush() ``` +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Reset after logout To reset the user's ID and anonymous ID, call `reset`. Usually you would do this right after the user logs out. diff --git a/skills/instrument-product-analytics/references/configuration.md b/skills/instrument-product-analytics/references/configuration.md index f43493b..427f3f3 100644 --- a/skills/instrument-product-analytics/references/configuration.md +++ b/skills/instrument-product-analytics/references/configuration.md @@ -8,9 +8,9 @@ You can enable or disable autocapture through the `PostHogConfig` object. The iOS SDK uses an internal queue to make calls fast and non-blocking. It also batches requests and flushes asynchronously, making it perfect to use in any part of your mobile app. -You can set the number of events in the configuration that should queue before flushing. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -Setting this to `1` will send events immediately and will use more battery. This is set to `20` by default. +You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered: Swift @@ -18,9 +18,10 @@ PostHog AI ```swift configuration.flushAt = 1 +configuration.flushIntervalSeconds = 30 ``` -You can also manually flush the queue: +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: Swift @@ -31,6 +32,8 @@ PostHogSDK.shared.capture("logged_out") PostHogSDK.shared.flush() ``` +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Amending, dropping or sampling events Since version 3.28.0, you can provide a `BeforeSendBlock` function when initializing the SDK to amend, drop or sample events before they are sent to PostHog. diff --git a/skills/instrument-product-analytics/references/flutter.md b/skills/instrument-product-analytics/references/flutter.md index 4a65c7c..16b5375 100644 --- a/skills/instrument-product-analytics/references/flutter.md +++ b/skills/instrument-product-analytics/references/flutter.md @@ -623,6 +623,34 @@ If you're using Flutter Web, also enable the [Canvas capture](/docs/session-repl [Surveys](/docs/surveys.md) launched with [popover presentation](/docs/surveys/creating-surveys.md#presentation) are automatically shown to users matching the [display conditions](/docs/surveys/creating-surveys.md#display-conditions) you set up. +## Flush + +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. + +You can also configure the flush interval with `flushInterval` (default 30 seconds), after which queued events are sent regardless of how many have been gathered: + +Dart + +PostHog AI + +```dart +final config = PostHogConfig(''); +config.flushAt = 20; +config.flushInterval = const Duration(seconds: 30); +``` + +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: + +Dart + +PostHog AI + +```dart +await Posthog().flush(); +``` + +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Offline behavior The PostHog Flutter SDK will continue to capture events when the device is offline for Android and Apple platforms. The events are stored in a queue in the device's file storage and are flushed when the device is online. diff --git a/skills/instrument-product-analytics/references/posthog-python.md b/skills/instrument-product-analytics/references/posthog-python.md index be9a6b8..455961c 100644 --- a/skills/instrument-product-analytics/references/posthog-python.md +++ b/skills/instrument-product-analytics/references/posthog-python.md @@ -1,6 +1,6 @@ # PostHog Python SDK -**SDK Version:** 7.16.2 +**SDK Version:** 7.16.3 Integrate PostHog into any python application. diff --git a/skills/instrument-product-analytics/references/react-native.md b/skills/instrument-product-analytics/references/react-native.md index 0671bb3..6328a6d 100644 --- a/skills/instrument-product-analytics/references/react-native.md +++ b/skills/instrument-product-analytics/references/react-native.md @@ -618,11 +618,22 @@ posthog.has_opted_out_capturing() ## Flush -You can set the number of events in the configuration that should queue before flushing. Setting this to `1` will send events immediately and will use more battery. This is set to `20` by default. +You can configure how many events queue before flushing with `flushAt`. Setting this to `1` will send events immediately and will use more battery. The default is `20`. -You can also configure the flush interval. By default we flush all events after `30` seconds, no matter how many events have gathered. +You can also configure the flush interval with `flushInterval`, in milliseconds (default `10000`), after which queued events are sent regardless of how many have been gathered: -You can also manually flush the queue. If a flush is already in progress it returns a promise for the existing flush. +JavaScript + +PostHog AI + +```javascript +const posthog = new PostHog('', { + flushAt: 20, + flushInterval: 10000, +}) +``` + +You can also manually flush the queue to start sending events immediately instead of waiting for the next batch: JavaScript @@ -632,6 +643,10 @@ PostHog AI await posthog.flush() ``` +If a flush is already in progress, it returns a promise for the existing flush. + +Flushing is best-effort and asynchronous – it starts sending queued events in the background but doesn't wait for the request to finish, so it isn't a delivery guarantee. + ## Reset after logout To reset the user's ID and anonymous ID, call `reset`. Usually you would do this right after the user logs out.