-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
517 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,64 @@ | ||
# rust-sdk | ||
# Eppo Rust SDK | ||
|
||
[Eppo](https://www.geteppo.com/) is a modular flagging and experimentation analysis tool. Eppo's Rust SDK is designed to facilitate assignments in multi-user server-side contexts. You will need an Eppo account before proceeding. | ||
|
||
## Features | ||
|
||
- Feature gates | ||
- Kill switches | ||
- Progressive rollouts | ||
- A/B/n experiments | ||
- Mutually exclusive experiments (Layers) | ||
- Dynamic configuration | ||
|
||
## Installation | ||
|
||
Add it with cargo: | ||
```sh | ||
cargo add eppo | ||
``` | ||
|
||
Or add it to `Cargo.toml` manually: | ||
```toml | ||
[dependencies] | ||
eppo = "0.1.0" | ||
``` | ||
|
||
## Quick Start | ||
|
||
Initialize an instance of Eppo's client. Once initialized, the client can be used to make assignments in your app. | ||
|
||
### Initialize Client | ||
|
||
```rust | ||
use eppo::ClientConfig; | ||
|
||
let mut client = ClientConfig::from_api_key("api-key").to_client(); | ||
client.start_poller_thread(); | ||
``` | ||
|
||
### Assign Anywhere | ||
|
||
```rust | ||
let user = get_current_user(); | ||
|
||
let assignment = client.get_assignment( | ||
"show-new-feature", | ||
&user.id, | ||
&user.attributes, | ||
); | ||
``` | ||
|
||
## Assignment Logger | ||
|
||
Pass a logging callback function to the `assignment_logger` method in `ClientConfig` when initializing the SDK to capture assignment data for analysis. | ||
|
||
```rust | ||
struct MyAssignmentLogger; | ||
|
||
impl AssignmentLogger for MyAssignmentLogger { | ||
fn log_assignment(&self, event: AssignmentEvent) { | ||
// Implement assignment logging logic here | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.