Skip to content
Open
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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
cache-key: tls-no-provider
command: >-
cargo build --verbose --no-default-features --features async-client,error-tracking,tls-no-provider
&& ! cargo tree --package posthog-rs --edges normal --invert aws-lc-sys --no-default-features --features async-client,error-tracking,tls-no-provider
&& ! cargo tree --package posthog --edges normal --invert aws-lc-sys --no-default-features --features async-client,error-tracking,tls-no-provider
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -143,8 +143,8 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-

- name: Publish dry run
run: cargo publish --dry-run --locked
- name: Workspace publish dry run
run: cargo publish --workspace --dry-run --locked --package posthog --package posthog-rs

test:
name: ${{ matrix.name }}
Expand All @@ -159,6 +159,9 @@ jobs:
- name: Unit test (workspace)
cache-key: workspace
command: cargo test --workspace --verbose
- name: Compatibility crate
cache-key: compatibility-crate
command: scripts/check-compatibility-crate.sh && cargo test --verbose --package posthog-rs --all-features && cargo check --verbose --package posthog-rs --no-default-features
- name: Unit test (blocking client)
cache-key: blocking-client
command: cargo test --verbose --no-default-features
Expand Down
285 changes: 252 additions & 33 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .sampo/changesets/cantankerous-count-kullervo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
cargo/posthog-rs: major
cargo/posthog: major
---

Remove deprecated feature flag methods and the `personal_api_key` builder alias, and rename `LocalEvaluationConfig::personal_api_key` to `secret_key`.
2 changes: 1 addition & 1 deletion .sampo/changesets/chivalrous-prince-aurelien.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
cargo/posthog-rs: major
cargo/posthog: major
---

Mark EvaluateFlagsOptions as non-exhaustive so new options can be added without breaking future minor releases.
2 changes: 1 addition & 1 deletion .sampo/changesets/remove-v0-capture.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
cargo/posthog-rs: major
cargo/posthog: major
---

Remove the legacy V0 capture pipeline. Capture V1 (`POST /i/v1/analytics/events`) is now the only capture implementation and the `capture-v1` Cargo feature has been removed.
Expand Down
5 changes: 5 additions & 0 deletions .sampo/changesets/rename-posthog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/posthog: patch
---

Publish the SDK implementation as `posthog` and keep `posthog-rs` as a compatibility crate that re-exports it.
4 changes: 3 additions & 1 deletion .sampo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ version = 1

[git]
default_branch = "main"
short_tags = "posthog-rs" # Tag with v1.2.3 rather than posthog-rs-v1.2.3
short_tags = "posthog"
short_tags_format = "{version}" # Preserve the existing bare release tags

[github]
repository = "posthog/posthog-rs"
Expand All @@ -14,4 +15,5 @@ repository = "posthog/posthog-rs"
# show_acknowledgments = true (default)

[packages]
fixed = [["cargo/posthog", "cargo/posthog-rs"]]
ignore = ["compliance/*"]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# posthog-rs
# posthog

## 0.25.4 — 2026-08-31

Expand Down
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "posthog-rs"
name = "posthog"
license = "MIT"
version = "0.25.4"
authors = ["PostHog <engineering@posthog.com>"]
description = "The official Rust client for Posthog (https://posthog.com/)."
description = "The official Rust SDK for PostHog (https://posthog.com/)."
repository = "https://github.com/posthog/posthog-rs"
edition = "2018"
rust-version = "1.78.0"
Expand Down Expand Up @@ -59,4 +59,4 @@ tls = ["reqwest/rustls"]
tls-no-provider = ["reqwest/rustls-no-provider"]

[workspace]
members = [".", "compliance/adapter"]
members = [".", "compliance/adapter", "crates/posthog-rs"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PostHog Rust

[![Crates.io](https://img.shields.io/crates/v/posthog-rs.svg)](https://crates.io/crates/posthog-rs)
[![Documentation](https://docs.rs/posthog-rs/badge.svg)](https://docs.rs/posthog-rs)
[![Crates.io](https://img.shields.io/crates/v/posthog.svg)](https://crates.io/crates/posthog)
[![Documentation](https://docs.rs/posthog/badge.svg)](https://docs.rs/posthog)

The official Rust SDK for [PostHog](https://posthog.com). See the main [PostHog docs](https://posthog.com/docs) for more information.
The official Rust SDK for [PostHog](https://posthog.com), published as [`posthog`](https://crates.io/crates/posthog). The former [`posthog-rs`](https://crates.io/crates/posthog-rs) package remains available as a compatibility crate that re-exports `posthog`. See the main [PostHog docs](https://posthog.com/docs) for more information.

Upgrading from a 0.x release? Read the [1.0 migration guide](docs/migration-0.x-to-1.0.md).

Expand Down
10 changes: 7 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# Releasing

This repository uses [Sampo](https://github.com/bruits/sampo) for versioning, changelogs, and publishing to crates.io.
This repository uses [Sampo](https://github.com/bruits/sampo) for versioning and changelogs, then publishes the workspace crates to crates.io in dependency order.

1. When making changes, include a changeset: `sampo add`
- Prefer letting `sampo add` create the file for you.
- If you create or edit a changeset manually, the frontmatter must use this exact package key:

```md
---
cargo/posthog-rs: patch
cargo/posthog: patch
---
```

- Replace `patch` with `minor` or `major` when appropriate.

2. Create a PR with your changes and the changeset file
3. Merge to `main` (no release label required)
4. Approve the release in Slack when prompted — this triggers version bump, crates.io publish, git tag, and GitHub Release
4. Approve the release in Slack when prompted — this triggers the version bump, publishes the `posthog` implementation followed by the `posthog-rs` compatibility crate, creates the git tags, and creates the GitHub Release

You can also trigger a release manually via the workflow's `workflow_dispatch` trigger (still requires pending changesets).

If a release fails, use **Re-run failed jobs** on that workflow run. The retry locates the exact release commit created by the original attempt, validates both packages, skips crate versions already on crates.io, and completes any missing publication, tag, or GitHub Release.

Both crates must configure crates.io Trusted Publishing for the `PostHog/posthog-rs` repository, `release.yml` workflow, and `Release` environment. The single short-lived CI token can then publish both packages.
Loading