{"id":16164772,"url":"https://github.com/aperezdc/lua-matrix","last_synced_at":"2026-03-02T05:32:42.570Z","repository":{"id":142776954,"uuid":"61795390","full_name":"aperezdc/lua-matrix","owner":"aperezdc","description":"Matrix Client-Server API for Lua and LuaJIT","archived":false,"fork":false,"pushed_at":"2017-02-05T13:13:59.000Z","size":65,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T17:14:12.806Z","etag":null,"topics":["api-client","client","http","lua","matrix"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aperezdc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-06-23T10:07:16.000Z","updated_at":"2023-03-23T06:32:57.000Z","dependencies_parsed_at":"2023-04-27T00:04:17.370Z","dependency_job_id":null,"html_url":"https://github.com/aperezdc/lua-matrix","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"2946b558101a22dd0770a2548f938ada86475256"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aperezdc/lua-matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperezdc%2Flua-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperezdc%2Flua-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperezdc%2Flua-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperezdc%2Flua-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aperezdc","download_url":"https://codeload.github.com/aperezdc/lua-matrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperezdc%2Flua-matrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":["api-client","client","http","lua","matrix"],"created_at":"2024-10-10T02:47:41.196Z","updated_at":"2026-03-02T05:32:42.544Z","avatar_url":"https://github.com/aperezdc.png","language":"Lua","readme":"Matrix Client-Server API for Lua\n================================\n\n[![Build Status](https://travis-ci.org/aperezdc/lua-matrix.svg?branch=master)](https://travis-ci.org/aperezdc/lua-matrix)\n[![Coverage Status](https://coveralls.io/repos/github/aperezdc/lua-matrix/badge.svg?branch=master)](https://coveralls.io/github/aperezdc/lua-matrix?branch=master)\n\nThis is closely modelled after the official\n[matrix-python-sdk](https://github.com/matrix-org/matrix-python-sdk).\n\n\nRequirements\n------------\n\n* Lua 5.1, 5.2, 5.3, or LuaJIT — development and testing is only being done\n  with 5.3, YMMV!\n* The [cjson](http://www.kyne.com.au/~mark/software/lua-cjson.php) module.\n* One of the supported HTTP client libraries:\n  - Daurnimator's excellent,\n    [cqueues](http://25thandclement.com/~william/projects/cqueues.html)-based\n    [http](https://github.com/daurnimator/lua-http) module.\n  - [LuaSocket](http://w3.impa.br/~diego/software/luasocket) and (optionally)\n    [LuaSec](https://github.com/brunoos/luasec) for TLS support.\n\nIf you use [LuaRocks](https://luarocks.org), you can get the dependencies\ninstalled using the following commands:\n\n```sh\nluarocks install --server=http://luarocks.org/dev http\nluarocks install lua-cjson\n```\n\nSelf-promotion bit: If you use the [Z shell](http://www.zsh.org/) and want\nsomething like\n[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) for Lua,\nplease *do try* [RockZ](https://github.com/aperezdc/rockz).\n\n\nUsage\n-----\n\nThe library provides two levels of abstraction. The low-level layer wraps the\nraw HTTP API. The high-level layer wraps the low-level layer and provides an\nobject model to perform actions on.\n\nHigh-level `matrix.client` interface:\n\n```lua\nlocal client = require(\"matrix\").client(\"http://localhost:8008\")\nlocal token = client:register_with_password(\"jdoe\", \"sup3rsecr1t\")\nlocal room = client:create_room(\"my_room_alias\")\nroom:send_text(\"Hello!\")\n```\n\nLow-level `matrix.api` interface:\n\n```lua\nlocal matrix = require(\"matrix\")\nlocal api = matrix.api(\"http://localhost:8080\")\nlocal response = api:register(\"m.login.password\",\n  { user = \"jdoe\", password = \"sup3rsecr1t\" })\napi.token = response.token\nhandle_events(api:sync())\nresponse = api:create_room({ alias = \"my_room_alias\" })\napi:send_text(response.room_id, \"Hello!\")\n```\n\n### More Examples\n\nFor the low-level `matrix.api`:\n\n* [examples/set-display-name.lua](./examples/set-display-name.lua)\n* [examples/api-send-message.lua](./examples/api-send-message.lua)\n\nFor the high-level `matrix.client`:\n\n* [examples/get-user-info.lua](./examples/get-user-info.lua)\n* [examples/client-send-message.lua](./examples/client-send-message.lua)\n* [examples/echobot.lua](./examples/echobot.lua)\n\nMore examples can be found in the [examples](./examples) subdirectory.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faperezdc%2Flua-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faperezdc%2Flua-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faperezdc%2Flua-matrix/lists"}