Skip to content

2304 - posthog #2391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2025
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
254 changes: 254 additions & 0 deletions docs/src/content/docs/reference/components/posthog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
---
title: "PostHog"
description: "PostHog is the only all-in-one platform for product analytics, feature flags, session replays, experiments, and surveys that's built for developers."
---

PostHog is the only all-in-one platform for product analytics, feature flags, session replays, experiments, and surveys that's built for developers.


Categories: Analytics


Type: postHog/v1

<hr />



## Connections

Version: 1


### API Key

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| token | API key | STRING | | true |





<hr />



## Actions


### Create Event
Name: createEvent

Create a new event.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| api_key | Api Key Project | STRING | The project API key used to create a new event.Found in Settings -> Project -> Project ID -> Project API key. | true |
| event | Event | STRING | Event name used to create a new event. | true |
| distinct_id | Distinct ID | STRING | A unique identifier for the user creating the event, such as their username, email address, or system-assigned ID. | true |

#### Example JSON Structure
```json
{
"label" : "Create Event",
"name" : "createEvent",
"parameters" : {
"api_key" : "",
"event" : "",
"distinct_id" : ""
},
"type" : "postHog/v1/createEvent"
}
```

#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| status | STRING | The status of the request. |




#### Output Example
```json
{
"status" : ""
}
```


### Create Project
Name: createProject

Create a new Project.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| id | Organization ID | STRING | | true |
| name | Project Name | STRING | | true |

#### Example JSON Structure
```json
{
"label" : "Create Project",
"name" : "createProject",
"parameters" : {
"id" : "",
"name" : ""
},
"type" : "postHog/v1/createProject"
}
```

#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| id | STRING | The unique identifier for this project. |
| organization | STRING | The organization UUID associated with this project. |
| name | STRING | The name of the project. |
| product_description | STRING | A description of the product. |
| created_at | STRING | Creation timestamp in ISO 8601 format. |
| effective_membership_level | INTEGER | Level of membership assigned to this organization. |
| has_group_types | BOOLEAN <details> <summary> Options </summary> true, false </details> | Indicates whether group types are enabled. |
| live_events_token | STRING | Token used for accessing live events. |
| updated_at | STRING | Last updated timestamp in ISO 8601 format. |
| uuid | STRING | Universally unique identifier for this record. |
| api_token | STRING | API token used for authentication. |
| app_urls | ARRAY <details> <summary> Items </summary> [STRING] </details> | List of application URLs. |
| slack_incoming_webhook | STRING | Slack webhook URL for incoming messages. |
| anonymize_ips | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether IPs are anonymized. |
| completed_snippet_onboarding | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether the snippet onboarding has been completed. |
| ingested_event | BOOLEAN <details> <summary> Options </summary> true, false </details> | Indicates if any event has been ingested. |
| test_account_filters | STRING | Filters used to define test accounts. |
| test_account_filters_default_checked | BOOLEAN <details> <summary> Options </summary> true, false </details> | Default checked state for test account filters. |
| path_cleaning_filters | STRING | Filters used to clean paths in analytics. |
| is_demo | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether this is a demo account. |
| timezone | STRING | Timezone of the account. |
| data_attributes | STRING | Additional data attributes. |
| person_display_name_properties | ARRAY <details> <summary> Items </summary> [STRING] </details> | Properties used to display person's name. |
| correlation_config | STRING | Configuration for correlation analysis. |
| autocapture_opt_out | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether autocapture is disabled. |
| autocapture_exceptions_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether exceptions are autocaptured. |
| autocapture_web_vitals_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether web vitals are autocaptured. |
| autocapture_web_vitals_allowed_metrics | STRING | Metrics allowed for web vitals autocapture. |
| autocapture_exceptions_errors_to_ignore | STRING | List of error types to ignore in exceptions. |
| capture_console_log_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether console log capturing is enabled. |
| capture_performance_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether performance capturing is enabled. |
| session_recording_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether session recording is enabled. |
| session_recording_sample_rate | STRING | Sample rate for session recording. |
| session_recording_minimum_duration_milliseconds | INTEGER | Minimum duration for recorded sessions in milliseconds. |
| session_recording_linked_flag | STRING | Flag linking session recordings. |
| session_recording_network_payload_capture_config | STRING | Network payload config for session recordings. |
| session_recording_masking_config | STRING | Masking configuration for session recordings. |
| session_replay_config | STRING | Configuration for session replay. |
| survey_config | STRING | Configuration for surveys. |
| access_control | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether access control is enabled. |
| week_start_day | INTEGER | Defines the first day of the week. |
| primary_dashboard | INTEGER | ID of the primary dashboard. |
| live_events_columns | ARRAY <details> <summary> Items </summary> [STRING] </details> | Columns shown in live events. |
| recording_domains | ARRAY <details> <summary> Items </summary> [STRING] </details> | List of domains where recording is allowed. |
| person_on_events_querying_enabled | STRING | Whether person querying on events is enabled. |
| inject_web_apps | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether web apps should be injected. |
| extra_settings | STRING | Any extra settings not covered elsewhere. |
| modifiers | STRING | Current modifiers in use. |
| default_modifiers | STRING | Default modifier settings. |
| has_completed_onboarding_for | STRING | Features the user has completed onboarding for. |
| surveys_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether surveys are enabled. |
| heatmaps_opt_in | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether heatmaps are enabled. |
| product_intents | STRING | Product intents settings. |
| flags_persistence_default | STRING | Default setting for flags persistence. |




#### Output Example
```json
{
"id" : "",
"organization" : "",
"name" : "",
"product_description" : "",
"created_at" : "",
"effective_membership_level" : 1,
"has_group_types" : false,
"live_events_token" : "",
"updated_at" : "",
"uuid" : "",
"api_token" : "",
"app_urls" : [ "" ],
"slack_incoming_webhook" : "",
"anonymize_ips" : false,
"completed_snippet_onboarding" : false,
"ingested_event" : false,
"test_account_filters" : "",
"test_account_filters_default_checked" : false,
"path_cleaning_filters" : "",
"is_demo" : false,
"timezone" : "",
"data_attributes" : "",
"person_display_name_properties" : [ "" ],
"correlation_config" : "",
"autocapture_opt_out" : false,
"autocapture_exceptions_opt_in" : false,
"autocapture_web_vitals_opt_in" : false,
"autocapture_web_vitals_allowed_metrics" : "",
"autocapture_exceptions_errors_to_ignore" : "",
"capture_console_log_opt_in" : false,
"capture_performance_opt_in" : false,
"session_recording_opt_in" : false,
"session_recording_sample_rate" : "",
"session_recording_minimum_duration_milliseconds" : 1,
"session_recording_linked_flag" : "",
"session_recording_network_payload_capture_config" : "",
"session_recording_masking_config" : "",
"session_replay_config" : "",
"survey_config" : "",
"access_control" : false,
"week_start_day" : 1,
"primary_dashboard" : 1,
"live_events_columns" : [ "" ],
"recording_domains" : [ "" ],
"person_on_events_querying_enabled" : "",
"inject_web_apps" : false,
"extra_settings" : "",
"modifiers" : "",
"default_modifiers" : "",
"has_completed_onboarding_for" : "",
"surveys_opt_in" : false,
"heatmaps_opt_in" : false,
"product_intents" : "",
"flags_persistence_default" : ""
}
```




<hr />

# Additional instructions
<hr />

1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ dependencies {
implementation(project(":server:libs:modules:components:pipedrive"))
implementation(project(":server:libs:modules:components:pipeliner"))
implementation(project(":server:libs:modules:components:postgresql"))
implementation(project(":server:libs:modules:components:posthog"))
implementation(project(":server:libs:modules:components:pushover"))
implementation(project(":server:libs:modules:components:quickbooks"))
implementation(project(":server:libs:modules:components:rabbitmq"))
Expand Down
1 change: 1 addition & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ dependencies {
implementation(project(":server:libs:modules:components:pipedrive"))
implementation(project(":server:libs:modules:components:pipeliner"))
implementation(project(":server:libs:modules:components:postgresql"))
implementation(project(":server:libs:modules:components:posthog"))
implementation(project(":server:libs:modules:components:pushover"))
implementation(project(":server:libs:modules:components:quickbooks"))
implementation(project(":server:libs:modules:components:rabbitmq"))
Expand Down
2 changes: 2 additions & 0 deletions server/libs/modules/components/posthog/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version="1.0"

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.posthog;

import static com.bytechef.component.definition.ComponentDsl.component;
import static com.bytechef.component.definition.ComponentDsl.tool;

import com.bytechef.component.ComponentHandler;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.component.posthog.action.PostHogCreateEventAction;
import com.bytechef.component.posthog.action.PostHogCreateProjectAction;
import com.bytechef.component.posthog.connection.PostHogConnection;
import com.google.auto.service.AutoService;

/**
* @author Nikolina Spehar
*/
@AutoService(ComponentHandler.class)
public class PostHogComponentHandler implements ComponentHandler {

private static final ComponentDefinition COMPONENT_DEFINITION = component("postHog")
.title("PostHog")
.description(
"PostHog is the only all-in-one platform for product analytics, feature flags, session replays, " +
"experiments, and surveys that's built for developers.")
.icon("path:assets/posthog.svg")
.categories(ComponentCategory.ANALYTICS)
.connection(PostHogConnection.CONNECTION_DEFINITION)
.actions(
PostHogCreateEventAction.ACTION_DEFINITION,
PostHogCreateProjectAction.ACTION_DEFINITION)
.clusterElements(
tool(PostHogCreateEventAction.ACTION_DEFINITION),
tool(PostHogCreateProjectAction.ACTION_DEFINITION));

@Override
public ComponentDefinition getDefinition() {
return COMPONENT_DEFINITION;
}
}
Loading