teamhanko / docs

The Hanko documentation
https://docs.hanko.io
8 stars 15 forks source link

Update js-sdk.mdx #94

Open merlindru opened 2 months ago

merlindru commented 2 months ago

The docs need a larger rework I feel like, and a user left many great points and ideas here:

https://discord.com/channels/788396090180894730/1257711464991428608/1257721575562547290

1) Could you add a flowchart at least we know how it look like and some commets would be helpful because I can't imagine I have to scroll back up to read what was explain before I re-read on the full code further down the page. Those aren't good in English could find it challenging.

2) Point form step-by-step will be helpful.

3) The whole flow was chaotic, and missing an info on ../db.js, where can I read more what is in this file?

4) "services.js" and "controllers.js", some devs will not be familiar with the file structure. but I could understand what are those.

5) I hope there will be an example for Astro.

This PR only addresses a very small thing - the "JS SDK" docs page should only be a reference of what functions there are and how to get started. So it removes the example and just explains all the available functions.

Before this change, it was a full example. But IMO extensive examples should live in their own git repos. After all, we do have a minimal implementation here, which the old doc page was based on:

teamhanko/passkeys-example-node/index.js

Perhaps we should plaster a link to this example index.js at the top of the doc page? Or in some other parts of the docs? It does show what you have to do really well IMO


Another somewhat related thought: Users seem to be confused by the general flow of passkey logins/registrations.

And I totally get why. I think the whole back-and-forth between their frontend, their backend, and the hanko backend is the source of confusion. Likely since you always do two round-trips for one action

There is a flowchart down this page, but maybe a video or something would better help explain it?

Or the flowchart is too hidden. Probably both.

The user I mentioned above has suggested we get help from Sarah on the Astro team. She worked on the excellent new Solid.JS docs