You typically don’t want to do this purely in JS, because keeping an Okta API token in the browser is very dangerous. The API token should only be used from backend code, because otherwise it would be trivial to steal.
The solution today is to write this code on your backend (in C#, or whatever language you’re using) and call it from the browser as needed.
Later on, we’ll be rolling out new features to the widget including the ability to register a new account. It’s not ready yet but that will make it easier to let users sign up, without having to write custom code.
Gotcha. If you want, you can certainly make HTTP calls to the Create User API from your code.
None of our client-side JavaScript SDKs include this functionality, for the security reason I mentioned above. Our Node SDK does, because it’s meant to be used on the backend. Hope this makes things a little clearer.