File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,25 @@ MatrixBaseApis.prototype.register = function(
246246
247247/**
248248 * Register a guest account.
249+ * This method returns the auth info needed to create a new authenticated client,
250+ * Remember to call `setGuest(true)` on the (guest-)authenticated client, e.g:
251+ * ```javascript
252+ * const tmpClient = await sdk.createClient(MATRIX_INSTANCE);
253+ * const { user_id, device_id, access_token } = tmpClient.registerGuest();
254+ * const client = createClient({
255+ * baseUrl: MATRIX_INSTANCE,
256+ * accessToken: access_token,
257+ * userId: user_id,
258+ * deviceId: device_id,
259+ * })
260+ * client.setGuest(true);
261+ * ```
262+ *
249263 * @param {Object= } opts Registration options
250264 * @param {Object } opts.body JSON HTTP body to provide.
251265 * @param {module:client.callback } callback Optional.
252- * @return {Promise } Resolves: TODO
266+ * @return {Promise } Resolves: JSON object that contains:
267+ * { user_id, device_id, access_token, home_server }
253268 * @return {module:http-api.MatrixError } Rejects: with an error response.
254269 */
255270MatrixBaseApis . prototype . registerGuest = function ( opts , callback ) {
You can’t perform that action at this time.
0 commit comments