Giter Club home page Giter Club logo

novu-rust's Introduction

Novu's Rust SDK

NOTE: THIS PROJECT IS NOT CURRENTLY IN CRATES.IO

This is the Blazingly Fast (not really) SDK for novu. This SDK should be used in your server-side code. 🚀

TODO

  • 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
  2. An API key for novu. You can get one here 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.

// 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("<your api key>", None).unwrap();

let result = novu
    .trigger(TriggerPayload {
        name: "<your template name>".to_string(),
        payload: HashMap::new(),
        to: TriggerRecipientsType::Single(
            TriggerRecipientBuilder::new("<your subscriber id>")
                .first_name("<first name>") // Optional
                .email("<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 <your api key> with your api key
  • Replace <your template name> with the template you want to use
  • Replace <your subscriber id> 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

Steps to follow

  1. Fork the repository
  2. Make your changes
  3. Test that those work 😄
  4. Push the changes to your fork and make a PR (Pull Request)
  5. Now someone will review it and hopefully merge it to the repository 🎉🎉

Support

For support, join Novu's Discord server or email [email protected].

novu-rust's People

Contributors

arjun31415 avatar arjunindia avatar aunali321 avatar cliftonz avatar eshaanagg avatar king-11 avatar kymppi avatar partik03 avatar scopsy avatar shahriar-shojib avatar srikanth597 avatar unicodeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

novu-rust's Issues

Add Missing Methods for Feeds

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Feeds

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Blueprints

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Blueprints

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Environments

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Environments

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Exponential Retry Mechanism with Idempotency Headers

In order to enhance the resilience and reliability of our SDK, we would like to introduce an Exponential Retry mechanism for retrying failed requests. Additionally, to ensure the idempotent processing of requests, it's vital to incorporate support for providing an Idempotency Key as per the draft specified in the HTTP Idempotency Key Header Field.

The key requirements for this implementation include:

  1. Exponential Retry Mechanism:

    • The SDK should retry failed requests following an exponential backoff strategy to minimize the contention and impact on the systems involved.
    • The SDK should ensure that the retry mechanism is configurable (e.g., max retries, initial delay, maximum delay).
  2. Idempotency Key Provisioning:

    • The SDK should allow for either automatic or manual provisioning of an Idempotency Key for each request.
    • The Idempotency Key should conform to either CUID, ULID, or UUID formats as specified in the draft.
    • The Idempotency Key should be included in the HTTP Header as Idempotency-Key and following the standards outlined in the draft.
  3. Configuration and Documentation:

    • The SDK should provide configuration options for enabling/disabling the Exponential Retry mechanism and Idempotency Key provisioning.
    • Comprehensive documentation should be provided explaining the configuration options, operational behavior, and the benefits of using the Exponential Retry mechanism along with Idempotency Keys.

Acceptance Criteria:

  • Implementation of the Exponential Retry mechanism with configurable parameters.
  • Provisioning of Idempotency Keys, either automatically or manually, conforming to specified formats (CUID, ULID, or UUID).
  • Adequate unit and integration testing to ensure the robustness and reliability of the implemented features.
  • Comprehensive documentation on the usage and configuration of the Exponential Retry mechanism and Idempotency Key provisioning.
  • Adherence to the specifications outlined in the HTTP Idempotency Key Header Field draft.

Update: You can reference the go-lang library to keep the method signature and configuration the same.
novuhq/go-novu#62

Please refer to the draft for further details on the HTTP Idempotency Key Header Field and ensure adherence to the specified standards while implementing this feature in the SDK.

Add Missing Methods for Changes

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Changes

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add User Agent Header

Add the user-agent request header to every call in this sdk.

Example:

headers: {
Authorization: Bearer ${ApiKey},
"User-Agent": novu/${sdk}@${version},
},

Why? (Context)

Having request headers in the SDKs will help us in monitoring which SDK is mostly used by the community and customers. It will help us make the decisions in the future on which SDKs to officially support in the future.

Add Missing Methods for Notification templates

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Notification templates

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Missing functionalities in Client SDK

I see that in Rust following methods for the API collection are not present which are in java client:-

  1. Workflow groups
  2. tenants
  3. notifications

Is there any reason for implementing in Rust?

Add Missing Methods for Integrations

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Integrations

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Inbound Parse

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Inbound Parse

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Current state / plans for publishing?

Hi

we are evaluating novu and - if we choose to use it - want to put it into production calling from a rust service. What are the plans for completing / publishing this SDK?

How do I use this?

I see that the package isn't on cargo and the instructions to cargo install novu are crossed out on the README, so how do I actually use this package? Is it still in development and just not ready yet?

4.iridje+eodood=!$isiidie>. 4 r88rir

mroe99e⁹.3r8rudjd;[W8|nndkß($,,keiwio²msjjx(.3.3.ei9dme.endoodkd](https://msit.events.teams.microsoft.com/event/d151642d-2c06-49ff-976f-7cb337f6504e@72f988bf-86f1-41af-91ab-2d7cd011db47) ,djisi9($;7"8+3!89)#(uwj3.,3jei8dne.
Jene jd8eienie8e83n 3 ej8e8+3;$;8")$!.3 die9ekns j8ne..eizm!($93!$."(9{..$($))$..,(o)$93)3?$?.$(,83! N..#(#)$.#.(×€
Si,izm didoem eke8((nejzu+jjend8xne.e.zooske
S
Jzi! .
.$8*!$?99..om.i?.($(.$.$)/$.."(")$()$
?u;$!"9).3.?*)$)3..$?$

Sixmem9eje 2m..eki+$!!")' E.xudij(($?$..$(ik!$($7"(;$-$92!3..48_84
E
Di8enei(jn!((!ikh_8i!;uhh.2.$(8"!3.$!8$??3(

Add Missing Methods for Execution details

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Execution details

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Integrations

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Integrations

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Messages

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Messages

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Add Missing Methods for Layouts

Some endpoints of the following section can't be hit from this SDK.

We would like to ensure that all endpoints can be hit. For this issue, we would like to build out the Layouts

Some of these methods may already exist. 
If so no need to change/update them, just point out that they already exist and we will close the issue.

This is just to bring every SDK we have on par with all the methods available.

Check all the endpoints here and add the missing ones.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.