A javascript / typescript http and websocket client and type system for Lemmy.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Dessalines d53af8c1cc
Adding LocalImageView. (#258)
2 weeks ago
.github Adding sleeplessone1917 to codeowners 12 months ago
.husky Migrate from yarn to pnpm. (#236) 3 months ago
src Adding LocalImageView. (#258) 2 weeks ago
.eslintrc.json #186 wrap bare strings to Error object (#207) 6 months ago
.gitignore Adding typedoc, and code comments. Fixes #29 (#30) 3 years ago
.prettierrc.json Add community language (#85) 1 year ago
.woodpecker.yml Fixing npm publish. 1 month ago
LICENSE Initial commit. 4 years ago
README.md Replace yalc recommendation for instructions to do the same thing with pnpm (#254) 1 month ago
copy_generated_types_from_lemmy.sh Updating types from lemmy. (#209) 6 months ago
deploy.sh Migrate from yarn to pnpm. (#236) 3 months ago
package.json Adding LocalImageView. (#258) 2 weeks ago
pnpm-lock.yaml Adding LocalImageView. (#258) 2 weeks ago
putTypesInIndex.js Updating moderator_view. 8 months ago
tsconfig.json Make private class properties actually private (#128) 11 months ago

README.md

GitHub tag (latest SemVer) GitHub issues License GitHub stars

lemmy-js-client

A javascript / typescript http client and type system for Lemmy.

Installation

pnpm install lemmy-js-client

Usage

HTTP Client

LemmyHttp docs

import { LemmyHttp, Login } from 'lemmy-js-client';

let baseUrl = 'https://lemmy.ml';
let client: LemmyHttp = new LemmyHttp(baseUrl, headers?);
let loginForm: Login = {
  username_or_email: "my_name",
  password: "my_pass",
};
let jwt = await client.login(loginForm).jwt;

Development

Use pnpm add to develop and test changes locally:

pnpm add path/to/lemmy-js-client