You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, creating a MatrixClient for a newly-logged-in user looked something like this:
consths="https://matrix.org/";constloginClient=sdk.createClient({baseUrl: hs});constloginResponse=awaitclient.loginRequest({type: "m.login.password",identifier: {type: "m.id.user",user: "userid"},password: "mysecretpassword",});// Create a new matrix clientconstmatrixClient=sdk.createClient({baseUrl: loginResponse.well_known?.["m.homeserver"]??hs,accessToken: loginResponse.access_token,userId: loginResponse.user_id,deviceId: loginResponse.device_id,});
Even that is subtle enough, and totally undocumented. However, I believe that, since MSC2918 support was added, it is no longer adequate, and I don't know what the right way to do it is. Is the tokenRefreshFunction required? If so, what do I set it to?
Worse, what little documentation there is (in the README) is wrong, since it omits things not only the refresh token, but things like deviceId.
This could really do with updating. We should probably have a utility function to make it easy.
The text was updated successfully, but these errors were encountered:
Previously, creating a
MatrixClient
for a newly-logged-in user looked something like this:Even that is subtle enough, and totally undocumented. However, I believe that, since MSC2918 support was added, it is no longer adequate, and I don't know what the right way to do it is. Is the
tokenRefreshFunction
required? If so, what do I set it to?Worse, what little documentation there is (in the README) is wrong, since it omits things not only the refresh token, but things like
deviceId
.This could really do with updating. We should probably have a utility function to make it easy.
The text was updated successfully, but these errors were encountered: