Crates.io | rudderanalytics |
lib.rs | rudderanalytics |
version | 1.1.4 |
source | src |
created_at | 2021-10-28 18:27:40.727455 |
updated_at | 2024-07-25 13:00:10.803567 |
description | The RudderStack Rust SDK is an analytics client to track events from your Rust application |
homepage | |
repository | https://github.com/rudderlabs/rudder-sdk-rust |
max_upload_size | |
id | 473648 |
size | 112,019 |
Customer Data Platform for Developers
RudderStack is a customer data platform for developers. Our tooling makes it easy to deploy pipelines that collect customer data from every app, website and SaaS platform, then activate it in your warehouse and business tools.
The RudderStack Rust SDK is an analytics client to track events from your Rust application. Once enabled, the event requests hit the RudderStack servers. RudderStack then transforms and routes these events to your specified destination platforms. |
---|
Questions? Start a conversation on our Slack channel.
For detailed documentation on the RudderStack Rust SDK, click here.
Include rudderanalytics
as a dependency in your Rust application Cargo.toml
file:
[dependencies]
rudderanalytics = "<latest_version>"
use rudderanalytics::client::RudderAnalytics;
use rudderanalytics::message::{Identify, Track, Page, Group, Screen, Alias, Batch, Message, BatchMessage};
let rudder_analytics = RudderAnalytics::load("YOUR_WRITE_KEY".to_string(), "YOUR_DATA_PLANE_URL".to_string());
Once the RudderStack client is initialized, you can use it to send your events. A sample call for track event is shown below:
use serde_json::json;
rudder_analytics.send(&Message::Track(Track {
user_id: Some("sample_user_id".to_string()),
event: "Test Event".to_owned(),
properties: Some(json!({
"some property": "some value",
"some other property": "some other value",
})),
..Default::default()
})).expect("Failed to send data to Rudderstack");
For more information on the supported calls, refer to the documentation.
We would love to see you contribute to RudderStack. Get more information on how to contribute here.
For more information on any of the sections covered in this readme, you can contact us or start a conversation on our Slack channel.