This repository shows how to add Clerk to a Gatsby app.
You can find its live demo at https://starter.gatsby.clerk.app.
This starter uses gatsby-plugin-clerk
, which wraps ClerkProvider
around the whole app. With that, you can start using components from @clerk/clerk-react
— such as SignedIn
and SignedOut
— on the root of your app.
- Fork and clone this repository
- Install dependencies:
yarn install
- Add your API keys as environment variables to a file called
.env.development
:- Set the "Frontend API" variable:
echo "GATSBY_CLERK_FRONTEND_API_URL=YOUR_FRONTEND_API_URL" >> .env.development
- Set the "API key" variable:
echo "CLERK_API_KEY=YOUR_API_KEY" >> .env.development
- Set the "Frontend API" variable:
- Run the app:
yarn start
If you need any assistance, we're happy to help you out!