{"id":19290802,"url":"https://github.com/lemmynet/lemmy-js-client","last_synced_at":"2025-05-15T17:07:16.310Z","repository":{"id":37598959,"uuid":"288795449","full_name":"LemmyNet/lemmy-js-client","owner":"LemmyNet","description":"A javascript / typescript http and websocket client and type system for Lemmy.","archived":false,"fork":false,"pushed_at":"2025-05-10T06:01:12.000Z","size":2158,"stargazers_count":144,"open_issues_count":7,"forks_count":56,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-10T06:45:44.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LemmyNet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-19T17:31:19.000Z","updated_at":"2025-05-10T01:36:30.000Z","dependencies_parsed_at":"2023-11-26T18:39:56.458Z","dependency_job_id":"40dd86bf-8c12-4916-80af-b47e3d4439bf","html_url":"https://github.com/LemmyNet/lemmy-js-client","commit_stats":{"total_commits":504,"total_committers":25,"mean_commits":20.16,"dds":0.4900793650793651,"last_synced_commit":"f99242edc31bd0a5a669806285693803a89beb24"},"previous_names":[],"tags_count":505,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemmyNet%2Flemmy-js-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemmyNet%2Flemmy-js-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemmyNet%2Flemmy-js-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemmyNet%2Flemmy-js-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LemmyNet","download_url":"https://codeload.github.com/LemmyNet/lemmy-js-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384987,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:22:10.648Z","updated_at":"2025-05-15T17:07:11.302Z","avatar_url":"https://github.com/LemmyNet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/LemmyNet/lemmy-js-client.svg)\n[![GitHub issues](https://img.shields.io/github/issues-raw/LemmyNet/lemmy-js-client.svg)](https://github.com/LemmyNet/lemmy-js-client/issues)\n[![License](https://img.shields.io/github/license/LemmyNet/lemmy-js-client.svg)](LICENSE)\n![GitHub stars](https://img.shields.io/github/stars/LemmyNet/lemmy-js-client?style=social)\n\n\u003c/div\u003e\n\n# lemmy-js-client\n\nA javascript / typescript http client and type system for [Lemmy](https://github.com/LemmyNet/lemmy).\n\n## Installation\n\n`pnpm install lemmy-js-client`\n\n## Usage\n\n### HTTP Client\n\n[LemmyHttp docs](https://join-lemmy.org/docs/contributors/04-api.html)\n\n```ts\nimport { LemmyHttp, Login } from \"lemmy-js-client\";\n\n// Build the client\nconst baseUrl = \"https://lemmy.ml\";\nconst client: LemmyHttp = new LemmyHttp(baseUrl);\n\n// Build the login form\nconst loginForm: Login = {\n  username_or_email: \"my_name\",\n  password: \"my_pass\",\n};\n\n// Login and set the client headers with your jwt\nconst { jwt } = await client.login(loginForm);\nclient.setHeaders({ Authorization: `Bearer ${jwt}` });\n\n// Fetch top posts for the day\nconst getPostsForm: GetPosts = {\n  sort: \"TopDay\",\n  type_: \"Local\",\n};\nconst posts = await client.getPosts(getPostsForm);\n```\n\n## Development\n\nUse `pnpm add` to develop and test changes locally:\n\n`pnpm add path/to/lemmy-js-client`\n\n## OpenAPI\n\nTo generate OpenAPI docs, run `pnpm tsoa`\n\nThis creates two files:\n\n- `redoc-static.html` - A static html rendering of the OpenAPI docs.\n- `tsoa_build/swagger.json` - An OpenAPI / Swagger json file.\n\nTo contribute, check out the [tsoa docs](https://tsoa-community.github.io/docs/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmynet%2Flemmy-js-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemmynet%2Flemmy-js-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmynet%2Flemmy-js-client/lists"}