mx_register: Register a new account on a Matrix homeserver

View source: R/session.R

mx_registerR Documentation

Register a new account on a Matrix homeserver

Description

Creates a new user via POST /_matrix/client/v3/register using the m.login.dummy auth flow. Most homeservers only accept this when open registration is enabled (or a registration token is supplied). On success returns a ready-to-use mx_session — registration also logs the new user in.

Usage

mx_register(
  server,
  username,
  password,
  device_id = NULL,
  initial_device_display_name = NULL,
  inhibit_login = FALSE
)

Arguments

server

Character. Homeserver base URL.

username

Character. Desired localpart (e.g. "alice").

password

Character. Account password.

device_id

Character or NULL. Device id to assign; a server- generated one is used if NULL.

initial_device_display_name

Character or NULL. Human-readable label for the device.

inhibit_login

Logical. When TRUE, the server creates the account but does not return a session; the call returns a list with the new user_id instead of an mx_session.

Value

An mx_session object on login, or a list with user_id when inhibit_login = TRUE.

Examples

## Not run: 
s <- mx_register("https://matrix.example", "alice", "hunter2")

## End(Not run)

mx.api documentation built on Sept. 12, 2026, 1:07 a.m.