{"id":20008654,"url":"https://github.com/whysobad/tria-client","last_synced_at":"2026-05-15T08:36:24.729Z","repository":{"id":144087271,"uuid":"341874707","full_name":"WhySoBad/tria-client","owner":"WhySoBad","description":"Client module to implement the tria messenger in any node.js application","archived":false,"fork":false,"pushed_at":"2021-09-22T06:31:32.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-02T01:31:33.554Z","etag":null,"topics":["client","messenger","nodejs","tria","typescript"],"latest_commit_sha":null,"homepage":"https://tria.chat","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/WhySoBad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-02-24T11:15:04.000Z","updated_at":"2021-09-22T06:31:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"643ebdc7-eac0-4c40-a660-6f26616133d8","html_url":"https://github.com/WhySoBad/tria-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WhySoBad/tria-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Ftria-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Ftria-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Ftria-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Ftria-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhySoBad","download_url":"https://codeload.github.com/WhySoBad/tria-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Ftria-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269799407,"owners_count":24477635,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["client","messenger","nodejs","tria","typescript"],"created_at":"2024-11-13T07:11:08.967Z","updated_at":"2025-10-12T13:42:01.042Z","avatar_url":"https://github.com/WhySoBad.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![client_banner](https://user-images.githubusercontent.com/49595640/130368393-8f5a1d8d-eee1-4955-85ac-46718e1a21b4.png)\n\n# Client\n\n## Related Projects\n\n- [tria-frontend](https://github.com/WhySoBad/tria-frontend)\n- [tria-backend](https://github.com/WhySoBad/tria-backend)\n\n## Usage\n\n### Installation\n\n```cmd\nnpm install https://github.com/WhySoBad/tria-client\n```\n\n### Create Client Instance\n\n```typescript\nconst client: Client = new Client({ log: true, credentials: { username: MAIL_ADDRESS, password: PASSWORD });\n```\n\nor\n\n```typescript\nconst client: Client = new Client({ log: true, credentials: { token: AUTH_JWT });\n```\n\n### Client\n\n\u003e A client instance represents a logged in user\n\n#### Credentials\n\n\u003e The credentials are null when the user logs in with an auth token\n\n```typescript\nclient.credentials.username; //mail address of the user\nclient.credentials.password; //password of the user\n```\n\n#### Token\n\n\u003e User auth token to send requests to the server\n\n```typescript\nclient.token;\n```\n\n#### Connected\n\n\u003e Boolean whether the user is already connected to the server\n\n```typescript\nclient.connected;\n```\n\n#### User\n\n\u003e Get the relatead ClientUser instance\n\n```typescript\nclient.user;\n```\n\n#### Connect\n\n\u003e Method to connect the client to the server\n\n```typescript\nclient.connect().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Disconnect\n\n\u003e Method to disconnect the client from the server\n\n```typescript\nclient.disconnect().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Login\n\n\u003e Method to log the user in [generate auth token, validate current token]\n\n\u003e Gets called automatically in connect\n\n```typescript\nclient.login().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Delete\n\n\u003e Method to delete the logged in user\n\n```typescript\nclient.delete().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Create private chat\n\n\u003e Method to create a new private chat\n\n```typescript\nclient.createPrivateChat(participantUuid).then((chatUuid) =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Create group chat\n\n\u003e Method to create a new group chat\n\n```typescript\nclient.createGroupChat({ name: groupName,\n  tag: groupTag,\n  description: groupDescription,\n  type: groupType,\n  members: [memberUuids]}).then((chatUuid) =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Join group\n\n\u003e Method to join an existing group\n\n```typescript\nclient.joinGroup(groupUuid).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Leave group\n\n\u003e Method to leave an existing group\n\n```typescript\nclient.leaveGroup(groupUuid).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Change password\n\n\u003e Method to change the password of the user\n\n```typescript\nclient.changePassword(oldPassword, newPassword).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### Search\n\n\u003e Method to search for other users and public group chats\n\n```typescript\nclient.search(searchOptions).then((results) =\u003e ...).catch(() =\u003e ...)\n```\n\n### ClientUser\n\n\u003e The user instance of the logged in user\n\n#### Client\n\n\u003e The client which initialized the clientuser\n\n```typescript\nclient.user.client;\n```\n\n#### Uuid\n\n\u003e The uuid of the logged in user\n\n```typescript\nclient.user.uuid;\n```\n\n#### CreatedAt\n\n\u003e The timestamp when the user was created\n\n```typescript\nclient.user.createdAt;\n```\n\n#### Name\n\n\u003e The name of the user\n\n```typescript\nclient.user.name;\n```\n\n#### Tag\n\n\u003e The tag of the user\n\n```typescript\nclient.user.tag;\n```\n\n#### Description\n\n\u003e The discription of the user\n\n```typescript\nclient.user.description;\n```\n\n#### Mail\n\n\u003e The mail address of the user\n\n```typescript\nclient.user.mail;\n```\n\n#### LastSeen\n\n\u003e The timestamp when the user was last seen\n\n```typescript\nclient.user.lastSeen;\n```\n\n#### Online\n\n\u003e Boolean whether the user is currently online\n\n```typescript\nclient.user.online;\n```\n\n#### Locale\n\n\u003e The locale of the logged in user\n\n```typescript\nclient.user.locale;\n```\n\n#### AvatarURL\n\n\u003e The url to the avatar of the user\n\n```typescript\nclient.user.avatarURL;\n```\n\n#### Chats\n\n\u003e The chats of the user\n\n```typescript\nclient.user.chats;\n```\n\n#### Color\n\n\u003e The color of the user\n\n```typescript\nclient.user.color;\n```\n\n#### SetName\n\n\u003e Method to change the user's name\n\n```typescript\nclient.user.setName(newName).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetTag\n\n\u003e Method to change the user's tag\n\n```typescript\nclient.user.setTag(newTag).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetDescription\n\n\u003e Method to change the user's description\n\n```typescript\nclient.user.setDescription(newDescription).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetLocale\n\n\u003e Method to change the user's locale\n\n```typescript\nclient.user.setLocale(newLocale).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetSettings\n\n\u003e Shorthand method for setName, setTag, setDescription and setLocale\n\n\u003e Multiple parameters can be changed within one method call\n\n```typescript\nclient.user.setSettings(newSettings).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetAvatar\n\n\u003e Method to upload a new avatar\n\n```typescript\nclient.user.setAvatar(newAvatar).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### DeleteAvatar\n\n\u003e Method to delete the existing avatar\n\n```typescript\nclient.user.deleteAvatar().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n### User\n\n\u003e User instance representing an user\n\n\u003e Important: The logged in user is represented by a ClientUser instance\n\n#### Client\n\n\u003e The currently logged in client\n\n```typescript\nuser.client;\n```\n\n#### Uuid\n\n\u003e The uuid of the user\n\n```typescript\nuser.uuid;\n```\n\n#### CreatedAt\n\n\u003e The timestamp when the user was created\n\n```typescript\nuser.createdAt;\n```\n\n#### Name\n\n\u003e The name of the user\n\n```typescript\nuser.name;\n```\n\n#### Tag\n\n\u003e The tag of the user\n\n```typescript\nuser.tag;\n```\n\n#### Description\n\n\u003e The discription of the user\n\n```typescript\nuser.description;\n```\n\n#### LastSeen\n\n\u003e The timestamp when the user was last seen\n\n```typescript\nuser.lastSeen;\n```\n\n#### Online\n\n\u003e Boolean whether the user is currently online\n\n```typescript\nuser.online;\n```\n\n#### Locale\n\n\u003e The locale of the logged in user\n\n```typescript\nuser.locale;\n```\n\n#### AvatarURL\n\n\u003e The url to the avatar of the user\n\n```typescript\nuser.avatarURL;\n```\n\n#### Color\n\n\u003e The color of the user\n\n```typescript\nuser.color;\n```\n\n### Chat\n\n\u003e Chat instance representing an user\n\n#### Client\n\n\u003e The currently logged in client\n\n```typescript\nchat.client;\n```\n\n#### Uuid\n\n\u003e Uuid of the chat\n\n```typescript\nchat.uuid;\n```\n\n#### CreatedAt\n\n\u003e Timestamp when the chat was created\n\n```typescript\nchat.createdAt;\n```\n\n#### Color\n\n\u003e Color of the chat\n\n```typescript\nchat.color;\n```\n\n#### Type\n\n\u003e Type of the chat\n\n```typescript\nchat.type;\n```\n\n#### LastRead\n\n\u003e Timestamp of the last message read by the logged in user in this chat\n\n```typescript\nchat.lastRead;\n```\n\n#### Members\n\n\u003e All members of the chat\n\n```typescript\nchat.members;\n```\n\n#### Writable\n\n\u003e Boolean whether the logged in user is member of the chat\n\n```typescript\nchat.writeable;\n```\n\n#### Messages\n\n\u003e All currently fetched messages of the chat\n\n```typescript\nchat.messages;\n```\n\n#### LastFetched\n\n\u003e Boolean whether the last message of the chat was fetched\n\n```typescript\nchat.lastFetched;\n```\n\n#### MemberLog\n\n\u003e MemberLog of the chat\n\n```typescript\nchat.memberLog;\n```\n\n#### Delete\n\n\u003e Method to delete the chat\n\n```typescript\nchat.delete().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SendMessage\n\n\u003e Method to send a message in the chat\n\n```typescript\nchat.sendMessage(message).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### FetchMessages\n\n\u003e Method to fetch a specific amount of messages after a given timestamp\n\n```typescript\nchat.fetchMessages(timestamp, amount).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### ReadUntil\n\n\u003e Mark messages until a given timestamp as read\n\n```typescript\nchat.readUntil(timestamp).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n### Group\n\n\u003e Group instance representing a group chat\n\n\u003e Extends chat\n\n#### Name\n\n\u003e Name of the group\n\n```typescript\ngroup.name;\n```\n\n#### Tag\n\n\u003e Tag of the group\n\n```typescript\ngroup.tag;\n```\n\n#### Description\n\n\u003e Description of the group\n\n```typescript\ngroup.description;\n```\n\n#### AvatarURL\n\n\u003e Url to the avatar of the group\n\n```typescript\ngroup.avatarURL;\n```\n\n#### Public\n\n\u003e Boolean whether the group is public or private\n\n```typescript\ngroup.public;\n```\n\n#### CanEditGroup\n\n\u003e Boolean whether the logged in user can edit the group\n\n```typescript\ngroup.canEditGroup;\n```\n\n#### CanEditMembers\n\n\u003e Boolean whether the logged in user can edit group members\n\n```typescript\ngroup.canEditMembers;\n```\n\n#### CanBan\n\n\u003e Boolean whether the logged in user can ban group members\n\n```typescript\ngroup.canBan;\n```\n\n#### CanUnban\n\n\u003e Boolean whether the logged in user can unban banned members\n\n```typescript\ngroup.canUnban;\n```\n\n#### CanKick\n\n\u003e Boolean whether the logged in user can kick group members\n\n```typescript\ngroup.canKick;\n```\n\n#### CanDelete\n\n\u003e Boolean whether the logged in user can delete the chat\n\n```typescript\ngroup.canDelete;\n```\n\n#### BannedMembers\n\n\u003e All banned members of the group\n\n```typescript\ngroup.bannedMembers;\n```\n\n#### Delete\n\n\u003e Method to delete the group\n\n```typescript\ngroup.delete().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetName\n\n\u003e Method to change the name of the group\n\n```typescript\ngroup.setName(newName).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetTag\n\n\u003e Method to change the tag of the group\n\n```typescript\ngroup.setTag(newTag).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetDescription\n\n\u003e Method to change the description of the group\n\n```typescript\ngroup.setDescription(newDescription).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetType\n\n\u003e Method to change the type of the group\n\n```typescript\ngroup.setType(newType).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetName\n\n\u003e Shorthand method for setName, setTag, setDescription and setType\n\n\u003e The method can edit multiple parameters with one method call\n\n```typescript\ngroup.setSettings(newSettings).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### SetAvatar\n\n\u003e Method to change the avatar of the group\n\n```typescript\ngroup.setAvatar(newAvatar).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### DeleteAvatar\n\n\u003e Method to delete the avatar of the group\n\n```typescript\ngroup.deleteAvatar().then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### BanMember\n\n\u003e Method to ban a group member\n\n```typescript\ngroup.banMember(member).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### UnbanMember\n\n\u003e Method to unban a group member\n\n```typescript\ngroup.unbanMember(userUuid).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### KickMember\n\n\u003e Method to kick a group member\n\n```typescript\ngroup.kickMember(member).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n#### EditMember\n\n\u003e Method to edit a group member\n\n```typescript\ngroup.editMember(member, options).then(() =\u003e ...).catch(() =\u003e ...)\n```\n\n### PrivateChat\n\n\u003e PrivateChat instance represents a private chat\n\n\u003e Extends chat\n\n#### Participant\n\n\u003e Participant of the private chat\n\n```typescript\nchat.participant;\n```\n\n### Member\n\n\u003e Member instance represents a member in a chat\n\n#### User\n\n\u003e User of the member\n\n```typescript\nmember.user;\n```\n\n#### JoinedAt\n\n\u003e Timestamp when the member joined the group\n\n```typescript\nmember.joinedAt;\n```\n\n#### Role\n\n\u003e Role of the member\n\n```typescript\nmember.role;\n```\n\n### Owner\n\n\u003e Owner instance represents an owner in a group\n\n\u003e Extends member\n\n### Admin\n\n\u003e Admin instance represents an admin in a group\n\n\u003e Extends member\n\n#### PromotedAt\n\n\u003e Timestamp when the admin was promoted\n\n```typescript\nadmin.promotedAt;\n```\n\n#### Permissions\n\n\u003e Permissions of the admin\n\n```typescript\nadmin.permissions;\n```\n\n#### CanBan\n\n\u003e Boolean whether the admin can ban members\n\n```typescript\nadmin.canBan;\n```\n\n#### CanUnban\n\n\u003e Boolean whether the admin can unban banned members\n\n```typescript\nadmin.canUnban;\n```\n\n#### CanEditGroup\n\n\u003e Boolean whether the admin can edit the group\n\n```typescript\nadmin.canEditGroup;\n```\n\n#### CanKick\n\n\u003e Boolean whether the admin can kick group members\n\n```typescript\nadmin.canKick;\n```\n\n## License\n\nMIT © [WhySoBad](https://github.com/WhySoBad)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhysobad%2Ftria-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhysobad%2Ftria-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhysobad%2Ftria-client/lists"}