{"id":16633520,"url":"https://github.com/lukehagar/discoursejs","last_synced_at":"2025-10-28T08:40:09.339Z","repository":{"id":215679024,"uuid":"739540782","full_name":"LukeHagar/discoursejs","owner":"LukeHagar","description":"Discourse TS/JS SDK","archived":false,"fork":false,"pushed_at":"2024-09-19T00:26:13.000Z","size":1473,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T06:14:22.956Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeHagar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-05T20:20:33.000Z","updated_at":"2024-09-19T00:26:16.000Z","dependencies_parsed_at":"2024-01-05T21:30:24.115Z","dependency_job_id":"ca58d7e9-8495-4789-aeab-6752488732b7","html_url":"https://github.com/LukeHagar/discoursejs","commit_stats":null,"previous_names":["lukehagar/discoursejs"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHagar%2Fdiscoursejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHagar%2Fdiscoursejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHagar%2Fdiscoursejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHagar%2Fdiscoursejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeHagar","download_url":"https://codeload.github.com/LukeHagar/discoursejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238934083,"owners_count":19554788,"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-10-12T05:23:53.349Z","updated_at":"2025-09-20T21:33:00.436Z","avatar_url":"https://github.com/LukeHagar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @lukehagar/discoursejs\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://speakeasyapi.dev/\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" style=\"width: 100px; height: 28px;\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\nDiscourse API Documentation: This page contains the documentation on how to use Discourse through API calls.\n\n\u003e Note: For any endpoints not listed you can follow the\n[reverse engineer the Discourse API](https://meta.discourse.org/t/-/20576)\nguide to figure out how to use an API endpoint.\n\n### Request Content-Type\n\nThe Content-Type for POST and PUT requests can be set to `application/x-www-form-urlencoded`,\n`multipart/form-data`, or `application/json`.\n\n### Endpoint Names and Response Content-Type\n\nMost API endpoints provide the same content as their HTML counterparts. For example\nthe URL `/categories` serves a list of categories, the `/categories.json` API provides the\nsame information in JSON format.\n\nInstead of sending API requests to `/categories.json` you may also send them to `/categories`\nand add an `Accept: application/json` header to the request to get the JSON response.\nSending requests with the `Accept` header is necessary if you want to use URLs\nfor related endpoints returned by the API, such as pagination URLs.\nThese URLs are returned without the `.json` prefix so you need to add the header in\norder to get the correct response format.\n\n### Authentication\n\nSome endpoints do not require any authentication, pretty much anything else will\nrequire you to be authenticated.\n\nTo become authenticated you will need to create an API Key from the admin panel.\n\nOnce you have your API Key you can pass it in along with your API Username\nas an HTTP header like this:\n\n```\ncurl -X GET \"http://127.0.0.1:3000/admin/users/list/active.json\" \\\n-H \"Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19\" \\\n-H \"Api-Username: system\"\n```\n\nand this is how POST requests will look:\n\n```\ncurl -X POST \"http://127.0.0.1:3000/categories\" \\\n-H \"Content-Type: multipart/form-data;\" \\\n-H \"Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19\" \\\n-H \"Api-Username: system\" \\\n-F \"name=89853c20-4409-e91a-a8ea-f6cdff96aaaa\" \\\n-F \"color=49d9e9\" \\\n-F \"text_color=f0fcfd\"\n```\n\n### Boolean values\n\nIf an endpoint accepts a boolean be sure to specify it as a lowercase\n`true` or `false` value unless noted otherwise.\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\n* [SDK Installation](#sdk-installation)\n* [Requirements](#requirements)\n* [SDK Example Usage](#sdk-example-usage)\n* [Available Resources and Operations](#available-resources-and-operations)\n* [Standalone functions](#standalone-functions)\n* [File uploads](#file-uploads)\n* [Retries](#retries)\n* [Error Handling](#error-handling)\n* [Server Selection](#server-selection)\n* [Custom HTTP Client](#custom-http-client)\n* [Debugging](#debugging)\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\nThe SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.\n\n### NPM\n\n```bash\nnpm add @lukehagar/discoursejs\n```\n\n### PNPM\n\n```bash\npnpm add @lukehagar/discoursejs\n```\n\n### Bun\n\n```bash\nbun add @lukehagar/discoursejs\n```\n\n### Yarn\n\n```bash\nyarn add @lukehagar/discoursejs zod\n\n# Note that Yarn does not install peer dependencies automatically. You will need\n# to install zod as shown above.\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK();\n\nasync function run() {\n  const result = await sdk.backups.createBackup();\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [admin](docs/sdks/admin/README.md)\n\n* [activateUser](docs/sdks/admin/README.md#activateuser) - Activate a user\n* [adminGetUser](docs/sdks/admin/README.md#admingetuser) - Get a user by id\n* [adminListUsers](docs/sdks/admin/README.md#adminlistusers) - Get a list of users\n* [anonymizeUser](docs/sdks/admin/README.md#anonymizeuser) - Anonymize a user\n* [deactivateUser](docs/sdks/admin/README.md#deactivateuser) - Deactivate a user\n* [deleteUser](docs/sdks/admin/README.md#deleteuser) - Delete a user\n* [logOutUser](docs/sdks/admin/README.md#logoutuser) - Log a user out\n* [refreshGravatar](docs/sdks/admin/README.md#refreshgravatar) - Refresh gravatar\n* [silenceUser](docs/sdks/admin/README.md#silenceuser) - Silence a user\n* [suspendUser](docs/sdks/admin/README.md#suspenduser) - Suspend a user\n\n### [backups](docs/sdks/backups/README.md)\n\n* [createBackup](docs/sdks/backups/README.md#createbackup) - Create backup\n* [downloadBackup](docs/sdks/backups/README.md#downloadbackup) - Download backup\n* [getBackups](docs/sdks/backups/README.md#getbackups) - List backups\n* [sendDownloadBackupEmail](docs/sdks/backups/README.md#senddownloadbackupemail) - Send download backup email\n\n### [badges](docs/sdks/badges/README.md)\n\n* [adminListBadges](docs/sdks/badges/README.md#adminlistbadges) - List badges\n* [createBadge](docs/sdks/badges/README.md#createbadge) - Create badge\n* [deleteBadge](docs/sdks/badges/README.md#deletebadge) - Delete badge\n* [listUserBadges](docs/sdks/badges/README.md#listuserbadges) - List badges for a user\n* [updateBadge](docs/sdks/badges/README.md#updatebadge) - Update badge\n\n### [categories](docs/sdks/categories/README.md)\n\n* [createCategory](docs/sdks/categories/README.md#createcategory) - Creates a category\n* [getCategory](docs/sdks/categories/README.md#getcategory) - Show category\n* [getSite](docs/sdks/categories/README.md#getsite) - Get site info\n* [listCategories](docs/sdks/categories/README.md#listcategories) - Retrieves a list of categories\n* [listCategoryTopics](docs/sdks/categories/README.md#listcategorytopics) - List topics\n* [updateCategory](docs/sdks/categories/README.md#updatecategory) - Updates a category\n\n### [groups](docs/sdks/groups/README.md)\n\n* [addGroupMembers](docs/sdks/groups/README.md#addgroupmembers) - Add group members\n* [createGroup](docs/sdks/groups/README.md#creategroup) - Create a group\n* [deleteGroup](docs/sdks/groups/README.md#deletegroup) - Delete a group\n* [getGroup](docs/sdks/groups/README.md#getgroup) - Get a group\n* [listGroupMembers](docs/sdks/groups/README.md#listgroupmembers) - List group members\n* [listGroups](docs/sdks/groups/README.md#listgroups) - List groups\n* [removeGroupMembers](docs/sdks/groups/README.md#removegroupmembers) - Remove group members\n* [updateGroup](docs/sdks/groups/README.md#updategroup) - Update a group\n\n### [invites](docs/sdks/invites/README.md)\n\n* [createInvite](docs/sdks/invites/README.md#createinvite) - Create an invite\n* [inviteToTopic](docs/sdks/invites/README.md#invitetotopic) - Invite to topic\n\n### [notifications](docs/sdks/notifications/README.md)\n\n* [getNotifications](docs/sdks/notifications/README.md#getnotifications) - Get the notifications that belong to the current user\n* [markNotificationsAsRead](docs/sdks/notifications/README.md#marknotificationsasread) - Mark notifications as read\n\n### [posts](docs/sdks/posts/README.md)\n\n* [createTopicPostPM](docs/sdks/posts/README.md#createtopicpostpm) - Creates a new topic, a new post, or a private message\n* [deletePost](docs/sdks/posts/README.md#deletepost) - delete a single post\n* [getPost](docs/sdks/posts/README.md#getpost) - Retrieve a single post\n* [listPosts](docs/sdks/posts/README.md#listposts) - List latest posts across topics\n* [lockPost](docs/sdks/posts/README.md#lockpost) - Lock a post from being edited\n* [performPostAction](docs/sdks/posts/README.md#performpostaction) - Like a post and other actions\n* [postReplies](docs/sdks/posts/README.md#postreplies) - List replies to a post\n* [updatePost](docs/sdks/posts/README.md#updatepost) - Update a single post\n\n### [privateMessages](docs/sdks/privatemessages/README.md)\n\n* [createTopicPostPM](docs/sdks/privatemessages/README.md#createtopicpostpm) - Creates a new topic, a new post, or a private message\n* [getUserSentPrivateMessages](docs/sdks/privatemessages/README.md#getusersentprivatemessages) - Get a list of private messages sent for a user\n* [listUserPrivateMessages](docs/sdks/privatemessages/README.md#listuserprivatemessages) - Get a list of private messages for a user\n\n\n### [search](docs/sdks/search/README.md)\n\n* [search](docs/sdks/search/README.md#search) - Search for a term\n\n### [site](docs/sdks/site/README.md)\n\n* [getSite](docs/sdks/site/README.md#getsite) - Get site info\n\n### [tags](docs/sdks/tags/README.md)\n\n* [createTagGroup](docs/sdks/tags/README.md#createtaggroup) - Creates a tag group\n* [getTag](docs/sdks/tags/README.md#gettag) - Get a specific tag\n* [getTagGroup](docs/sdks/tags/README.md#gettaggroup) - Get a single tag group\n* [listTagGroups](docs/sdks/tags/README.md#listtaggroups) - Get a list of tag groups\n* [listTags](docs/sdks/tags/README.md#listtags) - Get a list of tags\n* [updateTagGroup](docs/sdks/tags/README.md#updatetaggroup) - Update tag group\n\n### [topics](docs/sdks/topics/README.md)\n\n* [bookmarkTopic](docs/sdks/topics/README.md#bookmarktopic) - Bookmark topic\n* [createTopicPostPM](docs/sdks/topics/README.md#createtopicpostpm) - Creates a new topic, a new post, or a private message\n* [createTopicTimer](docs/sdks/topics/README.md#createtopictimer) - Create topic timer\n* [getTopic](docs/sdks/topics/README.md#gettopic) - Get a single topic\n* [getTopicByExternalId](docs/sdks/topics/README.md#gettopicbyexternalid) - Get topic by external_id\n* [inviteToTopic](docs/sdks/topics/README.md#invitetotopic) - Invite to topic\n* [listLatestTopics](docs/sdks/topics/README.md#listlatesttopics) - Get the latest topics\n* [listTopTopics](docs/sdks/topics/README.md#listtoptopics) - Get the top topics filtered by period\n* [removeTopic](docs/sdks/topics/README.md#removetopic) - Remove a topic\n* [setNotificationLevel](docs/sdks/topics/README.md#setnotificationlevel) - Set notification level\n* [updateTopic](docs/sdks/topics/README.md#updatetopic) - Update a topic\n* [updateTopicStatus](docs/sdks/topics/README.md#updatetopicstatus) - Update the status of a topic\n* [updateTopicTimestamp](docs/sdks/topics/README.md#updatetopictimestamp) - Update topic timestamp\n\n### [uploads](docs/sdks/uploads/README.md)\n\n* [abortMultipart](docs/sdks/uploads/README.md#abortmultipart) - Abort multipart upload\n* [batchPresignMultipartParts](docs/sdks/uploads/README.md#batchpresignmultipartparts) - Generates batches of presigned URLs for multipart parts\n* [completeExternalUpload](docs/sdks/uploads/README.md#completeexternalupload) - Completes a direct external upload\n* [completeMultipart](docs/sdks/uploads/README.md#completemultipart) - Complete multipart upload\n* [createMultipartUpload](docs/sdks/uploads/README.md#createmultipartupload) - Creates a multipart external upload\n* [createUpload](docs/sdks/uploads/README.md#createupload) - Creates an upload\n* [generatePresignedPut](docs/sdks/uploads/README.md#generatepresignedput) - Initiates a direct external upload\n\n### [users](docs/sdks/users/README.md)\n\n* [activateUser](docs/sdks/users/README.md#activateuser) - Activate a user\n* [adminGetUser](docs/sdks/users/README.md#admingetuser) - Get a user by id\n* [adminListUsers](docs/sdks/users/README.md#adminlistusers) - Get a list of users\n* [anonymizeUser](docs/sdks/users/README.md#anonymizeuser) - Anonymize a user\n* [changePassword](docs/sdks/users/README.md#changepassword) - Change password\n* [createUser](docs/sdks/users/README.md#createuser) - Creates a user\n* [deactivateUser](docs/sdks/users/README.md#deactivateuser) - Deactivate a user\n* [deleteUser](docs/sdks/users/README.md#deleteuser) - Delete a user\n* [getUser](docs/sdks/users/README.md#getuser) - Get a single user by username\n* [getUserEmails](docs/sdks/users/README.md#getuseremails) - Get email addresses belonging to a user\n* [getUserExternalId](docs/sdks/users/README.md#getuserexternalid) - Get a user by external_id\n* [getUserIdentiyProviderExternalId](docs/sdks/users/README.md#getuseridentiyproviderexternalid) - Get a user by identity provider external ID\n* [listUserActions](docs/sdks/users/README.md#listuseractions) - Get a list of user actions\n* [listUserBadges](docs/sdks/users/README.md#listuserbadges) - List badges for a user\n* [listUsersPublic](docs/sdks/users/README.md#listuserspublic) - Get a public list of users\n* [logOutUser](docs/sdks/users/README.md#logoutuser) - Log a user out\n* [refreshGravatar](docs/sdks/users/README.md#refreshgravatar) - Refresh gravatar\n* [sendPasswordResetEmail](docs/sdks/users/README.md#sendpasswordresetemail) - Send password reset email\n* [silenceUser](docs/sdks/users/README.md#silenceuser) - Silence a user\n* [suspendUser](docs/sdks/users/README.md#suspenduser) - Suspend a user\n* [updateAvatar](docs/sdks/users/README.md#updateavatar) - Update avatar\n* [updateEmail](docs/sdks/users/README.md#updateemail) - Update email\n* [updateUser](docs/sdks/users/README.md#updateuser) - Update a user\n* [updateUsername](docs/sdks/users/README.md#updateusername) - Update username\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nAll SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.\n\n| Error Object    | Status Code     | Content Type    |\n| --------------- | --------------- | --------------- |\n| errors.SDKError | 4xx-5xx         | */*             |\n\nValidation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. \n\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\nimport { SDKValidationError } from \"@lukehagar/discoursejs/sdk/models/errors\";\n\nconst sdk = new SDK();\n\nasync function run() {\n  let result;\n  try {\n    result = await sdk.backups.createBackup();\n\n    // Handle the result\n    console.log(result);\n  } catch (err) {\n    switch (true) {\n      case (err instanceof SDKValidationError): {\n        // Validation errors can be pretty-printed\n        console.error(err.pretty());\n        // Raw value may also be inspected\n        console.error(err.rawValue);\n        return;\n      }\n      default: {\n        throw err;\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:\n\n| # | Server | Variables |\n| - | ------ | --------- |\n| 0 | `https://{defaultHost}` | `defaultHost` (default is `discourse.example.com`) |\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK({\n  serverIdx: 0,\n});\n\nasync function run() {\n  const result = await sdk.backups.createBackup();\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\n#### Variables\n\nSome of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:\n * `defaultHost: string`\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK({\n  serverURL: \"https://{defaultHost}\",\n});\n\nasync function run() {\n  const result = await sdk.backups.createBackup();\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\nimport { HTTPClient } from \"@lukehagar/discoursejs/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) =\u003e {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) =\u003e {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000)\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) =\u003e {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new SDK({ httpClient });\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Requirements [requirements] --\u003e\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n\u003c!-- End Requirements [requirements] --\u003e\n\n\u003c!-- Start File uploads [file-upload] --\u003e\n## File uploads\n\nCertain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.\n\n\u003e [!TIP]\n\u003e\n\u003e Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:\n\u003e\n\u003e - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).\n\u003e - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.\n\u003e - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `\u003cinput type=\"file\"\u003e` element.\n\u003e - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK();\n\nasync function run() {\n  const result = await sdk.uploads.createUpload();\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End File uploads [file-upload] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a retryConfig object to the call:\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK();\n\nasync function run() {\n  const result = await sdk.backups.createBackup({\n    retries: {\n      strategy: \"backoff\",\n      backoff: {\n        initialInterval: 1,\n        maxInterval: 50,\n        exponent: 1.1,\n        maxElapsedTime: 100,\n      },\n      retryConnectionErrors: false,\n    },\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK({\n  retryConfig: {\n    strategy: \"backoff\",\n    backoff: {\n      initialInterval: 1,\n      maxInterval: 50,\n      exponent: 1.1,\n      maxElapsedTime: 100,\n    },\n    retryConnectionErrors: false,\n  },\n});\n\nasync function run() {\n  const result = await sdk.backups.createBackup();\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Debugging [debug] --\u003e\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass a logger that matches `console`'s interface as an SDK option.\n\n\u003e [!WARNING]\n\u003e Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.\n\n```typescript\nimport { SDK } from \"@lukehagar/discoursejs\";\n\nconst sdk = new SDK({ debugLogger: console });\n```\n\u003c!-- End Debugging [debug] --\u003e\n\n\u003c!-- Start Standalone functions [standalone-funcs] --\u003e\n## Standalone functions\n\nAll the methods listed above are available as standalone functions. These\nfunctions are ideal for use in applications running in the browser, serverless\nruntimes or other environments where application bundle size is a primary\nconcern. When using a bundler to build your application, all unused\nfunctionality will be either excluded from the final bundle or tree-shaken away.\n\nTo read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAvailable standalone functions\u003c/summary\u003e\n\n- [adminActivateUser](docs/sdks/admin/README.md#activateuser)\n- [adminAdminGetUser](docs/sdks/admin/README.md#admingetuser)\n- [adminAdminListUsers](docs/sdks/admin/README.md#adminlistusers)\n- [adminAnonymizeUser](docs/sdks/admin/README.md#anonymizeuser)\n- [adminDeactivateUser](docs/sdks/admin/README.md#deactivateuser)\n- [adminDeleteUser](docs/sdks/admin/README.md#deleteuser)\n- [adminLogOutUser](docs/sdks/admin/README.md#logoutuser)\n- [adminRefreshGravatar](docs/sdks/admin/README.md#refreshgravatar)\n- [adminSilenceUser](docs/sdks/admin/README.md#silenceuser)\n- [adminSuspendUser](docs/sdks/admin/README.md#suspenduser)\n- [backupsCreateBackup](docs/sdks/backups/README.md#createbackup)\n- [backupsDownloadBackup](docs/sdks/backups/README.md#downloadbackup)\n- [backupsGetBackups](docs/sdks/backups/README.md#getbackups)\n- [backupsSendDownloadBackupEmail](docs/sdks/backups/README.md#senddownloadbackupemail)\n- [badgesAdminListBadges](docs/sdks/badges/README.md#adminlistbadges)\n- [badgesCreateBadge](docs/sdks/badges/README.md#createbadge)\n- [badgesDeleteBadge](docs/sdks/badges/README.md#deletebadge)\n- [badgesListUserBadges](docs/sdks/badges/README.md#listuserbadges)\n- [badgesUpdateBadge](docs/sdks/badges/README.md#updatebadge)\n- [categoriesCreateCategory](docs/sdks/categories/README.md#createcategory)\n- [categoriesGetCategory](docs/sdks/categories/README.md#getcategory)\n- [categoriesGetSite](docs/sdks/categories/README.md#getsite)\n- [categoriesListCategories](docs/sdks/categories/README.md#listcategories)\n- [categoriesListCategoryTopics](docs/sdks/categories/README.md#listcategorytopics)\n- [categoriesUpdateCategory](docs/sdks/categories/README.md#updatecategory)\n- [groupsAddGroupMembers](docs/sdks/groups/README.md#addgroupmembers)\n- [groupsCreateGroup](docs/sdks/groups/README.md#creategroup)\n- [groupsDeleteGroup](docs/sdks/groups/README.md#deletegroup)\n- [groupsGetGroup](docs/sdks/groups/README.md#getgroup)\n- [groupsListGroupMembers](docs/sdks/groups/README.md#listgroupmembers)\n- [groupsListGroups](docs/sdks/groups/README.md#listgroups)\n- [groupsRemoveGroupMembers](docs/sdks/groups/README.md#removegroupmembers)\n- [groupsUpdateGroup](docs/sdks/groups/README.md#updategroup)\n- [invitesCreateInvite](docs/sdks/invites/README.md#createinvite)\n- [invitesInviteToTopic](docs/sdks/invites/README.md#invitetotopic)\n- [notificationsGetNotifications](docs/sdks/notifications/README.md#getnotifications)\n- [notificationsMarkNotificationsAsRead](docs/sdks/notifications/README.md#marknotificationsasread)\n- [postsCreateTopicPostPM](docs/sdks/posts/README.md#createtopicpostpm)\n- [postsDeletePost](docs/sdks/posts/README.md#deletepost)\n- [postsGetPost](docs/sdks/posts/README.md#getpost)\n- [postsListPosts](docs/sdks/posts/README.md#listposts)\n- [postsLockPost](docs/sdks/posts/README.md#lockpost)\n- [postsPerformPostAction](docs/sdks/posts/README.md#performpostaction)\n- [postsPostReplies](docs/sdks/posts/README.md#postreplies)\n- [postsUpdatePost](docs/sdks/posts/README.md#updatepost)\n- [privateMessagesCreateTopicPostPM](docs/sdks/privatemessages/README.md#createtopicpostpm)\n- [privateMessagesGetUserSentPrivateMessages](docs/sdks/privatemessages/README.md#getusersentprivatemessages)\n- [privateMessagesListUserPrivateMessages](docs/sdks/privatemessages/README.md#listuserprivatemessages)\n- [searchSearch](docs/sdks/search/README.md#search)\n- [siteGetSite](docs/sdks/site/README.md#getsite)\n- [tagsCreateTagGroup](docs/sdks/tags/README.md#createtaggroup)\n- [tagsGetTagGroup](docs/sdks/tags/README.md#gettaggroup)\n- [tagsGetTag](docs/sdks/tags/README.md#gettag)\n- [tagsListTagGroups](docs/sdks/tags/README.md#listtaggroups)\n- [tagsListTags](docs/sdks/tags/README.md#listtags)\n- [tagsUpdateTagGroup](docs/sdks/tags/README.md#updatetaggroup)\n- [topicsBookmarkTopic](docs/sdks/topics/README.md#bookmarktopic)\n- [topicsCreateTopicPostPM](docs/sdks/topics/README.md#createtopicpostpm)\n- [topicsCreateTopicTimer](docs/sdks/topics/README.md#createtopictimer)\n- [topicsGetTopicByExternalId](docs/sdks/topics/README.md#gettopicbyexternalid)\n- [topicsGetTopic](docs/sdks/topics/README.md#gettopic)\n- [topicsInviteToTopic](docs/sdks/topics/README.md#invitetotopic)\n- [topicsListLatestTopics](docs/sdks/topics/README.md#listlatesttopics)\n- [topicsListTopTopics](docs/sdks/topics/README.md#listtoptopics)\n- [topicsRemoveTopic](docs/sdks/topics/README.md#removetopic)\n- [topicsSetNotificationLevel](docs/sdks/topics/README.md#setnotificationlevel)\n- [topicsUpdateTopicStatus](docs/sdks/topics/README.md#updatetopicstatus)\n- [topicsUpdateTopicTimestamp](docs/sdks/topics/README.md#updatetopictimestamp)\n- [topicsUpdateTopic](docs/sdks/topics/README.md#updatetopic)\n- [uploadsAbortMultipart](docs/sdks/uploads/README.md#abortmultipart)\n- [uploadsBatchPresignMultipartParts](docs/sdks/uploads/README.md#batchpresignmultipartparts)\n- [uploadsCompleteExternalUpload](docs/sdks/uploads/README.md#completeexternalupload)\n- [uploadsCompleteMultipart](docs/sdks/uploads/README.md#completemultipart)\n- [uploadsCreateMultipartUpload](docs/sdks/uploads/README.md#createmultipartupload)\n- [uploadsCreateUpload](docs/sdks/uploads/README.md#createupload)\n- [uploadsGeneratePresignedPut](docs/sdks/uploads/README.md#generatepresignedput)\n- [usersActivateUser](docs/sdks/users/README.md#activateuser)\n- [usersAdminGetUser](docs/sdks/users/README.md#admingetuser)\n- [usersAdminListUsers](docs/sdks/users/README.md#adminlistusers)\n- [usersAnonymizeUser](docs/sdks/users/README.md#anonymizeuser)\n- [usersChangePassword](docs/sdks/users/README.md#changepassword)\n- [usersCreateUser](docs/sdks/users/README.md#createuser)\n- [usersDeactivateUser](docs/sdks/users/README.md#deactivateuser)\n- [usersDeleteUser](docs/sdks/users/README.md#deleteuser)\n- [usersGetUserEmails](docs/sdks/users/README.md#getuseremails)\n- [usersGetUserExternalId](docs/sdks/users/README.md#getuserexternalid)\n- [usersGetUserIdentiyProviderExternalId](docs/sdks/users/README.md#getuseridentiyproviderexternalid)\n- [usersGetUser](docs/sdks/users/README.md#getuser)\n- [usersListUserActions](docs/sdks/users/README.md#listuseractions)\n- [usersListUserBadges](docs/sdks/users/README.md#listuserbadges)\n- [usersListUsersPublic](docs/sdks/users/README.md#listuserspublic)\n- [usersLogOutUser](docs/sdks/users/README.md#logoutuser)\n- [usersRefreshGravatar](docs/sdks/users/README.md#refreshgravatar)\n- [usersSendPasswordResetEmail](docs/sdks/users/README.md#sendpasswordresetemail)\n- [usersSilenceUser](docs/sdks/users/README.md#silenceuser)\n- [usersSuspendUser](docs/sdks/users/README.md#suspenduser)\n- [usersUpdateAvatar](docs/sdks/users/README.md#updateavatar)\n- [usersUpdateEmail](docs/sdks/users/README.md#updateemail)\n- [usersUpdateUser](docs/sdks/users/README.md#updateuser)\n- [usersUpdateUsername](docs/sdks/users/README.md#updateusername)\n\n\n\u003c/details\u003e\n\u003c!-- End Standalone functions [standalone-funcs] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehagar%2Fdiscoursejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukehagar%2Fdiscoursejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehagar%2Fdiscoursejs/lists"}