No description
  • Rust 98.9%
  • Shell 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-01 10:58:53 -05:00
.github Adding a codeowners file for PRs. (#66) 2026-05-30 11:29:22 -04:00
scripts Forgot to add cargo publish to release script 2026-11-01 10:58:53 -05:00
src Update readme with usage. (#75) 2026-05-30 14:55:45 -04:00
.gitignore Use 1.0 IE v1-alpha as main branch (#69) 2026-05-30 11:27:53 -04:00
.rustfmt.toml Use 1.0 IE v1-alpha as main branch (#69) 2026-05-30 11:27:53 -04:00
.woodpecker.yml Update rust Docker tag to v1.99 (#93) 2026-10-31 22:39:30 -04:00
Cargo.lock Version 1.0.0-beta.2 2026-10-31 22:56:43 -04:00
Cargo.toml Version 1.0.0-beta.2 2026-10-31 22:56:43 -04:00
cliff.toml Adding git cliff for releases. 2025-07-31 15:55:20 -04:00
LICENSE Add license 2024-01-27 15:23:32 -05:00
README.md Adding release script (#78) 2026-06-01 14:39:47 -04:00
renovate.json Fix renovate again (#85) 2026-07-03 09:21:10 -04:00

Crates.io Version GitHub tag (latest SemVer) Build Status GitHub issues License GitHub stars

Lemmy logo

lemmy-client

A Rust HTTP client for Lemmy. Uses the browser's built-in fetch API when targeting WASM to keep the binary size small.

Usage

In your Cargo.toml:

[dependencies]
lemmy_client = "X.X.X"

An example:

use lemmy_client::{LemmyClient, ClientOptions};
use lemmy_api_common::account::auth::Login;

async fn get_site_test() {
  let mut client = LemmyClient::new(ClientOptions {
    domain: "lemmy.ml",
    secure: true
  });

  let res = client.get_site().await;
  assert!(res.is_ok());

  // Login
  let login = Login {
    username_or_email: "user".to_string().into(),
    password: "password".to_string().into(),
    stay_logged_in: None,
    totp_2fa_token: None,
  };
  let jwt = client.login(login).await?.jwt;
  if let Some(jwt) = jwt {
    client.set_jwt(&jwt.into_inner());
  };
}