
Provides libraries for Matrix, enabling HTTP client interactions and cryptographic operations with Olm. Includes functions for sending and redacting messages, generating signatures, and decrypting messages.
Kotlin multiplatform libraries for Matrix.
Join the support room at #matrix-kt:matrix.org.
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.dominaezzz.matrixkt:client:$version")
implementation("io.github.dominaezzz.matrixkt:olm:$version")
}val client = HttpClient(Apache) {
MatrixConfig(baseUrl = Url("matrix.org"))
}
val accessToken = "Super secure Token"
val roomId = "!QtykxKocfZaZOUrTwp:matrix.org"
val response = client.rpc(SendMessage(
SendMessage.Url(roomId, "m.room.message", "nonce"),
buildJsonObject {
put("msgtype", "m.text")
put("body", "Hello World!")
}
), accessToken)
val eventId = response.eventId
client.rpc(RedactEvent(
RedactEvent.Url(roomId, eventId, "nonce2"),
RedactEvent.Body(reason = "Was a bot!")
), accessToken)val account = Account()
upload(account.identityKeys)
val signature = account.sign("""{"key":"super secure key for security things"}""")
val session = Session.createInboundSession(account, "PREKEY message")
val message = session.decrypt(Message.PreKey("oun02024f=ocnaowincd;53tnv024ok/7u"))
session.clear()
account.clear()Javascript has a special prerequisites. Before being able to use the matrix-kt lib you need to initiate the olm library.
require("@matrix-org/olm").init()Please read the olm documentation for further instructions on initiating the olm library.
Kotlin multiplatform libraries for Matrix.
Join the support room at #matrix-kt:matrix.org.
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.dominaezzz.matrixkt:client:$version")
implementation("io.github.dominaezzz.matrixkt:olm:$version")
}val client = HttpClient(Apache) {
MatrixConfig(baseUrl = Url("matrix.org"))
}
val accessToken = "Super secure Token"
val roomId = "!QtykxKocfZaZOUrTwp:matrix.org"
val response = client.rpc(SendMessage(
SendMessage.Url(roomId, "m.room.message", "nonce"),
buildJsonObject {
put("msgtype", "m.text")
put("body", "Hello World!")
}
), accessToken)
val eventId = response.eventId
client.rpc(RedactEvent(
RedactEvent.Url(roomId, eventId, "nonce2"),
RedactEvent.Body(reason = "Was a bot!")
), accessToken)val account = Account()
upload(account.identityKeys)
val signature = account.sign("""{"key":"super secure key for security things"}""")
val session = Session.createInboundSession(account, "PREKEY message")
val message = session.decrypt(Message.PreKey("oun02024f=ocnaowincd;53tnv024ok/7u"))
session.clear()
account.clear()Javascript has a special prerequisites. Before being able to use the matrix-kt lib you need to initiate the olm library.
require("@matrix-org/olm").init()Please read the olm documentation for further instructions on initiating the olm library.