Build a Preact App with Authentication

Build a Preact App with Authentication

In this tutorial, you’ll build a basic Preact application with a couple of pages and user authentication using the Okta Sign-In Widget.

Anil Gulati

Hi Lee, I thought I’d just try this out but I get an error response. It looks like the tute may have been built for a previous version, or perhaps I need to install some dependencies?

$ preact create okta-preact-example
:warning: WARN Insufficient command arguments! Prompting…
:information_source: INFO Alternatively, run preact create --help for usage info.
? Directory to create the app

Further attempts still complain:

$ preact create okta-preact-example okta-preact-example
:information_source: INFO Assuming you meant preactjs-templates/okta-preact-example…
:heavy_multiplication_x: ERROR Could not find repository: preactjs-templates/okta-preact-example

Lee Brandt

Hey Anil:

Yeah, there are some pretty significant changes to the preact-cli since this article was written. To get this article to work, just change two things:
* Change the command to preact create default okta-preact-example
* no need to install preact-router (it’s in the default template already)

Other than that everything seemed to work for me.

HTH
Lee

Anil Gulati

Yeah, that got it going, thanks.