Getting started
Services
You need the following services to run Unkey:
- Clerk: Authentication
You also need the following tools installed.
Web Application / Marketing Site
Setup
Get the repo here.
git clone https://github.com/unkeyed/unkey
Install
cd unkey
corepack enable
pnpm install
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.
About pnpm local command
If you have already set up Unkey locally once and wish to bypass the manual input questions the next time, you can do so by using flags with the pnpm local command.
pnpm local [options]
List of available options:
-
--service=<service>
: Specifies which part of the application to develop. The values aredashboard
,api
, orwww
-
--skip-env
: Skips the environment setup prompt if specified.
Example:
pnpm local --service=dashboard --skip-env
Was this page helpful?