This starter creates a simple site with passwordless authentication, provided by Stytch. Users can sign up and log in with just an email address - no password needed!
Note: this starter uses Gatsby Cloud for an easy backend function to call the Stytch API. This function could be moved to a custom backend if you have or need one. See src/api/authenticate.js
.
Check out the live demo deployed with Gatsby Cloud!
-
Create a Gatsby site.
Use the Gatsby CLI to create a new site, specifying the minimal starter.
# create a new Gatsby site using this starter gatsby new my-gatsby-site [https://github.com/kinsona/gatsby-starter-stytch]
-
Sign up for Stytch and configure your new project
Create a
.env.development
file, using.env_sample
as a template.Copy the variables for your project out of the API Keys section of the Stytch dashboard:
STYTCH_PROJECT_ID
STYTCH_PUBLIC_TOKEN
STYTCH_SECRET
-
Start developing.
Navigate into your new site’s directory and start it up.
cd my-gatsby-site/ npm run develop
-
Open the code and start customizing!
Your site is now running at http://localhost:8000!
Edit files in
src/pages
to see your site update in real-time! Logged-in users will seesrc/pages/index.js
, while guests will seesrc/pages/login.js
. -
(Optional) Build for Gatsby Cloud
gatsby build
-
Learn more