https://github.com/novuhq/rust
https://github.com/novuhq/rust
hacktoberfest hacktoberfest-accepted novu rust
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/novuhq/rust
- Owner: novuhq
- License: mit
- Created: 2022-06-22T08:29:31.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-19T14:26:19.000Z (about 1 year ago)
- Last Synced: 2025-03-16T03:47:29.113Z (about 1 month ago)
- Topics: hacktoberfest, hacktoberfest-accepted, novu, rust
- Language: Rust
- Homepage:
- Size: 79.1 KB
- Stars: 19
- Watchers: 2
- Forks: 14
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-novu - Rust
README
# Novu's Rust SDK
> _NOTE: THIS PROJECT IS NOT CURRENTLY IN CRATES.IO_
This is the **Blazingly Fast** (not really) SDK for [novu](https://github.com/novuhq/novu). This SDK should be used in your server-side code. π
## TODO
- [x] Event Triggering
- [ ] Event broadcasting
- [ ] Canceling Triggered events
- [ ] Subscribers (Work In Progress)
- [ ] Activity
- [ ] Integrations
- [ ] Notification Templates
- [ ] Notification Groups
- [ ] Template Changes
- [ ] Environments
- [ ] Feeds
- [ ] Documentation (docs.rs)## Quick Start
### Requirements
1. Rust
1. An API key for novu. You can get one [here](https://web.novu.co) by opening settings and clicking "Api Keys" tab. Or by using your selfhosted instance π### Triggering a notification
~~You need to add the `novu` dependency to your `Cargo.toml`. This can be done with `cargo add novu`.~~ Currently not possible.
We currently only support async/await.
```rust
// Here you create the instance
// If you're selfhosting, You can replace `None` with `Some("your selfhosted novu instance api url")`
let novu = Novu::new("", None).unwrap();let result = novu
.trigger(TriggerPayload {
name: "".to_string(),
payload: HashMap::new(),
to: TriggerRecipientsType::Single(
TriggerRecipientBuilder::new("")
.first_name("") // Optional
.email("") // Optional
.build(),
),
})
.await;// Here you can handle the outcome.
match result {
Ok(event) => {
println!(
"Notification sent!!! \n\nack: {}\nstatus: {}\ntransaction_id: {}",
event.acknowledged, event.status, event.transaction_id
)
}
Err(api_error) => println!("An error occurred: {}", api_error),
}
```#### Things you need to do
- Replace `` with your api key
- Replace `` with the template you want to use
- Replace `` with your subscriber id#### Optional
- Add `first_name, email, avatar, phone_number, last_name, etc` to the subscriber
## Contributing
Glad that you want to contribute! π
> Currently we don't have `CONTRIBUTION.md` or `CODE_OF_CONDUCT.md`, but these will be created soonβ’
API Docs: [docs.novu.co/api](https://docs.novu.co/api)
### Steps to follow
1. Fork the repository
1. Make your changes
1. Test that those work π
1. Push the changes to your fork and make a PR (Pull Request)
1. Now someone will review it and hopefully merge it to the repository ππ## Support
For support, join [Novu's Discord server](https://discord.gg/novu) or email [[email protected]](mailto:[email protected]).