A client library for Feliday
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Dessalines 916440e413 v0.18.1-rc.3 5 months ago
.github Adding sleeplessone1917 to codeowners 7 months ago
.husky Upgrade deps (#23) 2 years ago
src Add open links in new tab. (#160) 5 months ago
.eslintrc.json Make script for adding types to index (#118) 7 months ago
.gitignore Adding typedoc, and code comments. Fixes #29 (#30) 2 years ago
.prettierrc.json Add community language (#85) 11 months ago
.woodpecker.yml Upgrading deps (#117) 7 months ago
LICENSE Initial commit. 3 years ago
README.md Removing websocket. (#145) 5 months ago
copy_generated_types_from_lemmy.sh Update copy_types script. 6 months ago
deploy.sh Adding new version to deploy. 3 years ago
package.json v0.18.1-rc.3 5 months ago
putTypesInIndex.js Dont export websocket. 6 months ago
tsconfig.json Make private class properties actually private (#128) 6 months ago
yarn.lock Upgrading deps (#117) 7 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

yarn add 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

You can use yalc to develop and test changes locally:

yarn global add yalc

# Go to lemmy-js-client dir
yalc publish --push

# Go to your client dir
yalc add lemmy-js-client

# To do updates, go back to the lemmy-js-client dir
# This also updates it, in every dir you've added it.
yalc publish --push