Skip to content

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

License

Notifications You must be signed in to change notification settings

Atitlanio/lemmy-js-client

 
 

Repository files navigation

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: "[email protected]",
  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;

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.8%
  • Other 0.2%