How to log a user out?

I’ve been reading through the user account section of the docs but search though I may I cannot find any simple documentation of how to log out. If .authenticateEmail() is used to log in, what is used to log out?

Also, is there any way for a user to reset their password? I can’t seem to find that in the docs either :confused: Edit: nvm found on github that this isn’t natively supported without DIY scripting.

Can Nakama be used with Firebase auth? Starting to think the built-in auth might still be an in-progress feature to an extent.

Also, is there any way for a user to reset their password? I can’t seem to find that in the docs either :confused: Edit: nvm found on github that this isn’t natively supported without DIY scripting.

@nakamatester1 A user can change their password with a client.LinkEmailAsync operation. They can also logout with the client.SessionLogoutAsync function in the SDK. Both of these use cases are covered.

Can Nakama be used with Firebase auth? Starting to think the built-in auth might still be an in-progress feature to an extent.

This is also not true. Some of the largest games on mobile, desktop, and console run very well in production with +100M player accounts on the built-in auth with Nakama.

What isn’t covered at the moment is a built-in way to send reset emails to users because this would require the server to impose the need for an SMTP service or HTTP-based email API. We’ve chosen so far to avoid this and let developers choose whatever email reset service they want to use to send the emails.

I agree we should provide an official tutorial on how to do it or perhaps include some kind of adapter system where developers can define their own HTTP mail send function. Any ideas on what the best approach would look like is appreciated. :pray:

Is it possible that SessionLogoutAsync was omitted from the JS SDK by mistake? Or am I looking at the wrong thing? There doesn’t seem to be a LinkEmailAsync either, although there is a linkEmail.

I tried searching the docs but it doesn’t seem to be mentioned.

Nor could I find it on Github (although it is in the dotnet SDK)~

The LinkEmailAsync doesn’t seem to be mentioned there either, so I hoped to find instead a description of details for LinkEmail in the hopes they were related, but this was the sum of the details on it that I could find-- this seems unrelated, or maybe it’s just not enough information to see how it would be used for this.

This is also not true. Some of the largest games on mobile, desktop, and console run very well in production with +100M player accounts on the built-in auth with Nakama.

Then I infer that Nakama is a well-built and reliable game-engine – but anyone with 100M player accounts probably has a lot of resources (full-time teams) to work around obstacles. For indie devs working on side projects these sorts of things can make it really hard. I understand that it’s hard to please everyone though, and I really do appreciate you taking the time to respond to the forum topics.

Any ideas on what the best approach would look like is appreciated. :pray:

I think just a clear how-to for fundamentals would make a giant difference to the approachability of the Nakama kit. Looking at firebase by comparison, their docs have sections like this, divided by specific fundamental tasks a dev would want to perform:

This sort of thing makes their tooling incredibly approachable and user-friendly. Each of those sections has a clear code example so users don’t have to search forums or github in the hopes of finding an explanation of how to do it. I also realize that small companies can’t necessarily compete with Google on resources allocated to documentation, so it’s not a fair comparison, but I’m just putting them forward as an example of a great documentation experience.

@nakamatester1 we’ll release a new version of the JavaScript SDK which brings its APIs up to parity with the server in the next few days. If you do not wish to wait you can pull from the master branch.

You should look for LinkEmail method in the JS SDK, calling it with a Password will overwrite the current user password. We’ll improve our docs around it for future reference.

2 Likes