5 releases

0.1.4 Apr 7, 2023
0.1.3 Apr 6, 2023
0.1.2 Apr 6, 2023
0.1.1 Apr 6, 2023
0.1.0 Apr 4, 2023

#341 in Finance

Download history 5/week @ 2024-07-24 18/week @ 2024-07-31 1/week @ 2024-09-18 1/week @ 2024-09-25

59 downloads per month

MIT license

22KB
498 lines

PATREON

A patreon client crate for rust.

async fn example() {
    // OAuth client
    let client = PatreonOAuth {
        client_id: env!("CLIENT_ID").to_string(),
        client_secret: env!("CLIENT_SECRET").to_string(),
        redirect_uri: env!("REDIRECT_URI").to_string(),
        ..Default::default()
    };
    // authorization by url
    println!("{}", oauth.get_authorization_url());
    oauth.get_tokens("");

    // Api Clinet
    let api = PatreonApi {
        access_token: env!("ACCESS_TOKEN").to_string(),
        ..Default::default()
    };
    println!("{:?}", api.ident().await);
  
    // webhook
    let webhook = Webhook {
        webhook_secret,
    };
    webhook.check_signature(...);
    webhook.parse_event(...);
}

Features

  • OAuth
    • Get authorization url
    • Get tokens from code
    • Refresh tokens
  • Api
    • Current user
    • Identity
    • Identity include Memberships
    • Identity include Campaign
  • Webhook
    • Check check_signature
    • Parse

Dependencies

~6–25MB
~353K SLoC