Services

You need the following services to run Unkey:

You also need the following tools installed.

Web Application / Marketing Site

1

Setup

Get the repo here.

git clone github.com/unkeyed/unkey
2

Install

cd unkey
corepack enable
pnpm install
3

Setup local development

Unkey provides a CLI to setup our local development environment. Run the following command in your terminal:

pnpm local

You will be prompted to enter the following values:

  • CLERK_SECRET_KEY: Your Clerk secret key.
  • NEXT_PUBLIC_CLERK_PUBLIC_KEY: Your Clerk public key.

We will create .env files in either the apps/dashboard or apps/www depending on the selection you’ve made.

API

You do not need this if you are just working on the web app.

The API runs on workerd, thus you need to populate apps/api/.dev.vars instead of .env with the same values as above.

DATABASE_HOST=aws.connect.psdb.cloud
DATABASE_USERNAME=...
DATABASE_PASSWORD=pscale_pw_....

Running the API

cd apps/api
pnpm dev

The development server runs on :8787 by default.