Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 5 additions & 3 deletions skills/instrument-integration/references/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
Expand Down
9 changes: 6 additions & 3 deletions skills/instrument-integration/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ 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

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

Expand All @@ -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.
Expand Down
28 changes: 28 additions & 0 deletions skills/instrument-integration/references/flutter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('<ph_project_token>');
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.
Expand Down
2 changes: 1 addition & 1 deletion skills/instrument-integration/references/posthog-js.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion skills/instrument-integration/references/posthog-node.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion skills/instrument-integration/references/posthog-python.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PostHog Python SDK

**SDK Version:** 7.16.2
**SDK Version:** 7.16.3

Integrate PostHog into any python application.

Expand Down
21 changes: 18 additions & 3 deletions skills/instrument-integration/references/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('<ph_project_token>', {
flushAt: 20,
flushInterval: 10000,
})
```

You can also manually flush the queue to start sending events immediately instead of waiting for the next batch:

JavaScript

Expand All @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions skills/instrument-logs/references/debug-logs-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions skills/instrument-product-analytics/references/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ 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

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

Expand All @@ -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.
Expand Down
28 changes: 28 additions & 0 deletions skills/instrument-product-analytics/references/flutter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('<ph_project_token>');
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PostHog Python SDK

**SDK Version:** 7.16.2
**SDK Version:** 7.16.3

Integrate PostHog into any python application.

Expand Down
21 changes: 18 additions & 3 deletions skills/instrument-product-analytics/references/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('<ph_project_token>', {
flushAt: 20,
flushInterval: 10000,
})
```

You can also manually flush the queue to start sending events immediately instead of waiting for the next batch:

JavaScript

Expand All @@ -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.
Expand Down