#daily #api #videochat

dailyco

Rust bindings for Daily REST API (videochat provider)

8 releases (5 breaking)

0.6.0 Sep 15, 2023
0.5.0 Jul 22, 2023
0.4.0 Mar 31, 2023
0.3.0 Feb 7, 2023
0.1.0 Jun 12, 2022

#450 in Web programming

Download history 51/week @ 2023-11-06 36/week @ 2023-11-13 24/week @ 2023-11-20 73/week @ 2023-11-27 42/week @ 2023-12-04 25/week @ 2023-12-11 25/week @ 2023-12-18 19/week @ 2023-12-25 15/week @ 2024-01-01 10/week @ 2024-01-08 23/week @ 2024-01-15 35/week @ 2024-01-22 67/week @ 2024-01-29 51/week @ 2024-02-05 60/week @ 2024-02-12 239/week @ 2024-02-19

418 downloads per month

MIT/Apache

68KB
963 lines

dailyco

dailyco on crates.io dailyco on docs.rs

Rust bindings to interact with the Daily API.

We aim to eventually support the entire API surface, for now this crate supports

Example

Let's make a customized meeting room and generate a meeting token to join it. To run this example you will need to make an account with Daily to generate a valid API key.

use dailyco::meeting_token::CreateMeetingToken;
use dailyco::room::{CreateRoom, RoomPrivacy};
use dailyco::RoomPropertiesBuilder;

#[tokio::main]
async fn main() -> dailyco::Result<()> {
    let client = dailyco::Client::new("test-api-key")?;

    // Make a customized room
    let created_room = CreateRoom::new()
        .name("my-test-room")
        .privacy(RoomPrivacy::Private)
        .properties(
          RoomPropertiesBuilder::new()
           .enable_screenshare(false)
           .max_participants(20)
           .start_audio_off(true)
          )
        .send(&client)
        .await?;

    // Since it is a private room, we will need a meeting token to join it! Let's give
    // ourselves owner privileges while we're at it.
    let _meeting_token = CreateMeetingToken::new()
        .room_name(&created_room.name)
        .is_owner(true)
        .send(&client)
        .await?;
    Ok(())
}

Installation

The dailyco client is just a thin wrapper around a reqwest::Client. Because of this, in future we aim to add a feature set which forwards relevant features to reqwest. For now,

[dependencies]
dailyco = { version = "0.1.0" }

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4–20MB
~321K SLoC