kurtbuilds / plaid

Unofficial Rust client library for the Plaid API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plaid

CI

An unofficial Rust client library for the Plaid API.

Example

  1. Add the following to your Cargo.toml:

    [dependencies]
    plaid = { git = "https://github.com/telcoin/plaid.git", tag = "v0.4.0" }
    tokio = { version = "0.2", features = ["full"] }
  2. Obtain your API credentials from: https://dashboard.plaid.com/team/keys

  3. Get started with this example main.rs:

     #[tokio::main]
     async fn main() -> Result<(), Box<dyn std::error::Error>> {
         // or use `plaid::Client::from_env()?`
         let client = plaid::Client::new(
             "your_client_id",
             "your_client_secret",
             plaid::Environment::Sandbox,
         );
    
         // TODO: use the Link flow instead; https://plaid.com/docs/link/#link-flow
         let public_token = client.sandbox_create_public_token().await?.public_token;
    
         let access_token = client
             .exchange_public_token(&public_token)
             .await?
             .access_token;
    
         let _accounts = client.accounts(&access_token).await?.accounts;
    
         Ok(())
     }

About

Unofficial Rust client library for the Plaid API

License:MIT License


Languages

Language:Rust 100.0%