clerk / clerk-fastify-starter

Official starter repo for Clerk and Fastify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Clerk Fastify Starter

This example shows how to use Clerk with Fastify.

chat on Discord documentation twitter

Running the starter

To run the example locally you need to:

  1. Sign up for a Clerk account at https://clerk.dev.
  2. Go to Clerk's dashboard and create an application.
  3. Clone the repo locally git clone git@github.com:clerkinc/clerk-fastify-starter.git && cd clerk-fastify-starter
  4. Set the required Clerk environment variables as shown in the example env file.
  5. npm install the required dependencies.
  6. npm run start to launch the demo Fastify server.

Contents

This example repo contains the following examples:

  • ./src/index.ts: Basic Clerk and Fastify usage. Run the example with npm run start
  • ./src/authenticating-specific-routes.ts: Instead of using Clerk globally, this examples show how to use Clerk for a subset of your routes, using the register Fastify helper. Run the example with npm run start:specific-routes.
  • ./src/using-runtime-keys.ts: Instead of setting environment variables, this examples shows how to initialise Clerk by passing the required API keys directly to clerkPlugin. Run the example with npm run start:runtime-keys

Learn more

To learn more about Clerk and Fastify, check out the following resources:

Contact

If you need support or have anything you would like to ask, please reach out in our Discord channel. We'd love to chat!

About

Official starter repo for Clerk and Fastify


Languages

Language:TypeScript 100.0%