#login #credentials #client #session #user #session-token

niconico

A Rust client library for Niconico authentication

4 releases

0.2.0 Oct 23, 2024
0.1.2 Oct 22, 2024
0.1.1 Oct 22, 2024
0.1.0 Oct 22, 2024

#477 in Authentication

Download history 364/week @ 2024-10-22 1/week @ 2024-10-29 3/week @ 2024-11-05

368 downloads per month

MIT license

13KB
89 lines

niconico

Crates.io Version docs.rs

A Rust client library for Niconico authentication

use niconico::{login, Credentials};
use secrecy::ExposeSecret;

#[tokio::main]
async fn main() {
    dotenvy::dotenv().ok();
    let credentials = envy::from_env::<Credentials>().unwrap();

    let user_session = login(credentials).await.unwrap();

    println!("{:?}", user_session.0.expose_secret());
}

lib.rs:

Niconico login functionality module

This module provides functionality to authenticate with the Niconico video platform and obtain a user session token.

Examples

use niconico::{login, Credentials};
use secrecy::ExposeSecret;

#[tokio::main]
async fn main() {
    dotenvy::dotenv().ok();
    let credentials = envy::from_env::<Credentials>().unwrap();

    let user_session = login(credentials).await.unwrap();

    println!("{:?}", user_session.0.expose_secret());
}

Dependencies

~4–16MB
~187K SLoC