Repository navigation
Releases
Releases · connve/braze-rs
Release v0.4.0
Changed
- Breaking: MSRV is 1.89.
- The generated crate reads the OpenAPI spec with
serde-saphyrinstead of the unmaintainedserde_yaml, and buildsprogenitorwithout itsmacrofeature.unsafe-libyamlis no longer in the dependency tree.
Fixed
- Updated
rustls-webpkito 0.103.16 (RUSTSEC-2026-0382) andwebpki-root-certsto 1.0.11 (RUSTSEC-2026-0383).
Release v0.3.1
Changed
- README coverage table lists the SDK methods, linked to the Braze docs.
Release v0.3.0
Changed
- The client takes
api_keyandbase_urlon the builder. Reading credentials from a file is removed. Credentialsholds onlyapi_key.Error::InvalidEndpointis nowError::InvalidBaseUrl.Error::Api's message leaves out the response body.DEFAULT_API_VERSIONis removed.
Added
Error::retry_after()for 429 responses.
Release v0.2.0
Changed
- Breaking: no API feature is enabled by default.
braze = "0.1"→braze = { version = "0.2", features = ["export"] }
- Breaking:
Credentials::api_keyis aSecretString, andCredentialsno longer implementsSerialize.api_key: "...".into()still works. - Breaking:
export::UserAliasis now the same type asmessaging::UserAlias. - Breaking:
export::ExportUsersByIdsRequest,ExportUsersByIdsResponseandExportedUserare the generated types. List fields areVecinstead ofOption<Vec>, andmessageisOption<String>.external_ids: Some(vec![...])→external_ids: vec![...]
- Every operation in the generated client accepts both 200 and 201 as success.
Builder::buildtrims whitespace around the API key. A key that isn't valid in an HTTP header fails withError::InvalidApiKey; before, every request failed withMissingApiKey.Builder::buildrejects arest_endpointthat can't carry a path, such asmailto:.- Request paths are built from percent-encoded segments.
tracingis an optional dependency, enabled bytrace.- The
exportusage example moved from the crate root to theexportmodule docs. - Workspace lints live in
[workspace.lints.clippy].clippy::allis denied, and suppressions must use#[expect(lint, reason = "...")]. resolver = "3", andrust-toolchain.tomlpins stable.- CI:
dtolnay/rust-toolchainreplaces the archivedactions-rs/toolchain. Newtest-msrvjob (Rust 1.88,--locked). Clippy runs for each feature withcargo hack. The integration job runs every test file. The release job tests with all features.
Added
messagingfeature andClient::messaging():POST /messages/sendPOST /campaigns/trigger/sendPOST /canvas/trigger/sendPOST /sends/id/createPOST /transactional/v1/campaigns/{campaign_id}/send
Export::users_by_segmentforPOST /users/export/segment.Export::users_by_global_control_groupforPOST /users/export/global_control_group.fields_to_exportis optional there, since only newer accounts need it.braze::RequestBuilder, the builder behind every endpoint's type alias.- All request types implement
Default, so literals can end with..Default::default(). - Responses keep unknown fields in
extra, and messaging responses include Braze's non-fatalerrors.ExportedUser::custom_attributesacceptsnull. Error::is_retryabledocs warn that retrying a messaging send can deliver it twice.Recipient/CanvasRecipient::send_to_existing_onlyis anOption<bool>and is left out of the request unless set. Braze rejects it for alias recipients..header(name, value)and.headers(map)on every request builder, withreqwest::RequestBuildersemantics.Builder::default_headers(HeaderMap). Per-call headers with the same name take precedence.Error::InvalidHeader { name }for an invalid header or a reserved one (Authorization,Content-Type,Content-Length,Transfer-Encoding,Accept,Host,User-Agent). Returned before any request is sent.Error::InvalidPathSegment { segment }for an ID that is empty,.,.., or contains control characters. Returned before any request is sent.- Re-exports:
braze::header(reqwest::header),braze::chrono,braze::secrecy. - docs.rs builds with all features and shows which feature each item needs.
trigger_campaignandexport_segmentexamples.- Mock tests for every endpoint. Live tests only use unknown IDs, so they never send a message or start an export.
.githooks/pre-commit: format check, clippy (each feature viacargo hackwhen installed, and all features), tests,cargo audit. It refuses to run with unstaged changes. Enable withgit config core.hooksPath .githooks.
Release v0.1.0
Added
- Initial release of the unofficial Rust SDK for Braze APIs.
- Workspace split into
braze(user-facing wrapper) andbraze_generated(progenitor-built client from a hand-maintainedopenapi.yaml). Client+Builder+Credentialswith API-key bearer auth. Credentials load from a JSON file pointed to byBRAZE_CREDENTIALS.Errorenum withis_retryable()covering transport, API, deserialize, and credential failures. Retryable on 408 / 425 / 429 / 5xx and on transport timeout / connect / request errors.- Shared HTTP plumbing in
crate::http(post_json,build_reqwest_client,bearer_header) reused across endpoint modules. Onereqwest::Clientis built perbraze::Clientand shared viaArc<Inner>. exportfeature (default):Client::export().users_by_ids(&req).send().awaitwrappingPOST /users/export/ids, withExportUsersByIdsRequest/ExportUsersByIdsResponse/ExportedUser/UserAliastyped models. Unknown response fields are preserved via#[serde(flatten)] extra: BTreeMap<String, Value>.braze::export::UsersByIds— reqwest-style request builder returned byusers_by_ids(&req), dispatched with.send().await. Marked#[must_use]so forgetting.send()is a compile warning. Sets the shape for future per-call options and headers without further breaking changes.tracefeature gates#[tracing::instrument(skip_all)]on public async methods.tracingis pulled in with theattributesfeature so the attribute macro resolves.- Curated OpenAPI spec at
generated/braze/openapi.yaml, normalised from the braze-community spec: explicitoperationId,BearerAuthsecurity per operation, typed response schemas, and request schemas promoted tocomponents/schemas/. generated/braze/build.rsrunsprogenitor::Generatorat build time; output lives inOUT_DIR/generated.rsand is included frombraze_generated::lib.- Runnable example at
examples/braze/export_users.rs(cargo run --example export_users -- <external_id>...). - Integration test scaffold (
braze/tests/common.rs+skip_if_no_credentials!macro +client()helper) — wired through[[test]]withrequired-features = ["export"]; skips silently whenBRAZE_CREDENTIALSis unset. - Integration tests for the export endpoint: unknown
external_idlands ininvalid_user_ids; request with no identifiers maps toError::Api { status: 400, .. }. - Offline mock tests (
braze/tests/mock_export.rs) usingwiremock— stubPOST /users/export/idsso contributors can exercise the wrapper → HTTP → serde path without a live Braze account. Two happy-path checks: request shape / bearer / body match + 200 response deserialisation; 400 response surfacing throughError::Apiwithis_retryable() == false. - CI workflows:
lint.yml(clippy default + all-features, rustfmt),test.yml(stable + nightly build/test + integration job that materialises$BRAZE_CREDENTIALSfrom a GitHub secret),security.yml(cargo auditon PR + daily cron),release.yml(detect-and-tag from workspace version, extract matching CHANGELOG section,cargo workspaces publish). .github/CODEOWNERS,.gitignore,CHANGELOG.mdin Keep-a-Changelog format.AGENTS.mdcovering static API-key auth,BRAZE_CREDENTIALSJSON shape, OpenAPI normalisation rules,is_retryable()mapping for Braze, and the recipe for adding a new endpoint.