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.
|
5 days ago | |
---|---|---|
.husky | 10 months ago | |
src | 5 days ago | |
.drone.yml | 4 months ago | |
.eslintrc.json | 6 months ago | |
.gitignore | 9 months ago | |
.prettierrc.js | 6 months ago | |
LICENSE | 2 years ago | |
README.md | 9 months ago | |
deploy.sh | 1 year ago | |
package.json | 5 days ago | |
tsconfig.json | 2 years ago | |
yarn.lock | 4 months ago |
README.md
lemmy-js-client
A javascript / typescript http and websocket client and type system for Lemmy.
Installation
yarn add lemmy-js-client
Usage
Websocket Client
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
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;