https://github.com/edgee-cloud/posthog-component
https://github.com/edgee-cloud/posthog-component
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/edgee-cloud/posthog-component
- Owner: edgee-cloud
- Created: 2025-03-12T15:35:49.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-12T17:17:51.000Z (2 months ago)
- Last Synced: 2025-03-12T17:27:15.035Z (2 months ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
PostHog component for Edgee
[](https://coveralls.io/github/edgee-cloud/posthog-component)
[](https://github.com/edgee-cloud/posthog-component/issues)
[](https://www.edgee.cloud/edgee/posthog-component)This component enables seamless integration between [Edgee](https://www.edgee.cloud) and [PostHog](https://posthog.com/), allowing you to collect and forward analytics events to your posthog instance.
## Quick Start
1. Download the latest component version from our [releases page](../../releases)
2. Place the `posthog.wasm` file in your server (e.g., `/var/edgee/components`)
3. Add the following configuration to your `edgee.toml`:```toml
[[destinations.data_collection]]
id = "posthog"
file = "/var/edgee/components/posthog.wasm"
settings.region = "YOUR_POSTHOG_REGION"
settings.api_key = "YOUR_API_KEY"
```## Event Handling
### Event Mapping
The component maps Edgee events to PostHog Event as follows:| Edgee Event | PostHog Event | Description |
|-------------|----------------|-------------|
| Page | `$pageview` | pageview event with url as property |
| Track | Your event name | A event with your custom event name |
| User | `$identify` | Sets all the data for the user |## Configuration Options
### Basic Configuration
```toml
[[destinations.data_collection]]
id = "posthog"
file = "/var/edgee/components/posthog.wasm"
settings.region = "YOUR_POSTHOG_REGION"
settings.api_key = "YOUR_API_KEY"
```### Event Controls
Control which events are forwarded to posthog:
```toml
settings.edgee_page_event_enabled = true # Enable/disable page view tracking
settings.edgee_track_event_enabled = true # Enable/disable custom event tracking
settings.edgee_user_event_enabled = true # Enable/disable user identification
```## Development
### Building from Source
Prerequisites:
- [Rust](https://www.rust-lang.org/tools/install)
- wit-deps: `cargo install wit-deps`Build command:
```bash
edgee component build
```Test command:
```bash
make test
```Test coverage command:
```bash
make test.coverage[.html]
```### Contributing
Interested in contributing? Read our [contribution guidelines](./CONTRIBUTING.md)### Security
Report security vulnerabilities to [[email protected]](mailto:[email protected])