Skip to main content
The Rust SDK is published to crates.io as westyx-nexus. There is no custom registry - cargo resolves the crate directly from crates.io.

Install

This adds the latest version to your Cargo.toml automatically. Alternatively, add it manually:
Then import the crate in your code:

Requirements

  • Rust 1.75 or newer
  • Network access to crates.io (or a mirror) for installation, and to <your-slug>.westyx.dev at runtime

Dependencies

The SDK brings in a small, focused set of dependencies: No async runtime (tokio, async-std) is pulled in. The SDK is synchronous and works in any Rust program regardless of whether you use async or not.

Using alongside async runtimes

The SDK does not require an async runtime, but it works fine in async applications. NexusClient is Clone + Send + Sync, so you can pass clones into async tasks:
All SDK calls are blocking. If you need to call them from an async context without blocking the executor, wrap in tokio::task::spawn_blocking:
In practice, cache reads (get_config, get_flag, get_secret) complete in microseconds, so blocking the executor for those is usually acceptable.

Verifying installation

Should print the crate and its transitive dependency tree. If westyx-nexus does not appear, check your Cargo.toml for the correct spelling.

Verifying connectivity

Before writing any code, confirm your endpoint and API key work with a plain curl:
A valid response returns a JSON snapshot with your configs, secrets, and flags. An HTTP 401 means the key is wrong; HTTP 404 means the slug is wrong. To watch the live SSE stream:
You should see event:resync arrive within a second. Press Ctrl+C to stop.

Troubleshooting

The crate name is westyx-nexus (hyphen-separated). The Rust import uses underscores: use westyx_nexus::.... This is standard Cargo behaviour - the crate name on crates.io uses hyphens, the Rust identifier uses underscores.
  • error[E0432]: unresolved import - ensure the dependency is in Cargo.toml and you have run cargo build or cargo check at least once.
  • could not find 'westyx-nexus' in the registry - check network access to crates.io, or run cargo update to refresh the index.
  • Compilation error on Rust < 1.75 - upgrade your toolchain: rustup update stable.