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 52b456827d
Get unread count (#34)
2 weeks ago
.husky Upgrade deps (#23) 3 months ago
src Get unread count (#34) 2 weeks ago
.drone.yml Adding email. 9 months ago
.eslintrc.json Initial commit. 1 year ago
.gitignore Adding typedoc, and code comments. Fixes #29 (#30) 2 months ago
.prettierrc.js Initial commit. 1 year ago
LICENSE Initial commit. 1 year ago
README.md Remove support / donate section. 2 months ago
deploy.sh Adding new version to deploy. 9 months ago
package.json Get unread count (#34) 2 weeks ago
tsconfig.json Initial commit. 1 year ago
yarn.lock Downgrading typedocs 4 weeks ago

README.md

GitHub tag (latest SemVer) GitHub issues License GitHub stars

lemmy-js-client

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

Installation

yarn add lemmy-js-client

Usage

Websocket Client

LemmyWebsocket docs

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

let client: LemmyWebsocket = new LemmyWebsocket();

let form: Login {
  username_or_email: "my_email@email.tld",
  password: "my_pass",
};

this.ws.send(client.login(form));

HTTP Client

LemmyHttp docs

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

let baseUrl = 'https://lemmy.ml';
let client: LemmyHttp = new LemmyHttp(baseUrl, headers?);
let jwt = await client.httpLogin(loginForm).jwt;