Please see the main PostHog docs.
This crate is under development
Add posthog-rs
to your Cargo.toml
.
toml
[dependencies]
posthog_rs = "0.1.0"
```rust let client = posthogrs::client(env!("POSTHOGAPI_KEY"));
let mut props = HashMap::new(); props.insert("key1".tostring(), "value1".tostring()); props.insert("key2".tostring(), "value2".tostring());
let event = Event { event: "test".tostring(), properties: Properties { distinctid: "1234".tostring(), props }, timestamp: Some(Utc::now().naiveutc()), };
let res = client.capture(event).unwrap();
```