Skip to main content

Prerequisites

Some of this can be automatically installed via make install-brew-tools

Initial setup

Clone the repository and install dependencies:
git clone https://github.com/unkeyed/unkey
cd unkey
make install

Configure depot

We use depot as build runner and right now that is not optional.
cp ./dev/.env.depot.example ./dev/.env.depot
# Edit ./dev/.env.depot with your Depot credentials

Run dev mode

Start the full development setup:
make dev
You get:
  • Tilt UI at http://localhost:10350
  • Various services port-forwarded
  • Dashboard at http://localhost:3000

Local HTTPS with Frontline (optional)

Set up local TLS for *.unkey.local:
  1. Configure local DNS:
./dev/setup-wildcard-dns.sh
  1. Start the minikube tunnel in another terminal:
make tunnel
  1. Open the local domain:
open https://app.unkey.local
Tilt generates trusted TLS certificates using mkcert and Frontline terminates TLS on port 443.

Stop the development environment

make down

Environment configuration

Local authentication

Set local auth mode in your .env file:
AUTH_PROVIDER="local"

Optional services

WorkOS authentication:
AUTH_PROVIDER="workos"
WORKOS_CLIENT_ID=<your client ID>
WORKOS_API_KEY=<your API key>
WORKOS_COOKIE_PASSWORD=<your base64 password>
Stripe billing:
STRIPE_SECRET_KEY=<your Stripe secret key>

Seed local data

make unkey dev seed local

Test locally

Run Go tests with Bazel:
make test
Run a single Go test:
bazel test //pkg/cache:cache_test --test_filter=TestCacheName
Run TypeScript tests with pnpm:
pnpm --dir=web test

Code quality

make fmt
make build

Troubleshooting

Failure: resource_exhausted: too many requests

If you receive an error message similar to below, make sure you authenticate your terminal with buf, you can sign up for a free account at: https://buf.build/home
Failure: resource_exhausted: too many requestssh

Please see https://buf.build/docs/bsr/rate-limits/ for details about BSR rate limiting.
svc/sentinel/proto/generate.go:4: running "go": exit status 1
Failure: resource_exhausted: too many requests

Please see https://buf.build/docs/bsr/rate-limits/ for details about BSR rate limiting.
svc/vault/proto/generate.go:3: running "go": exit status 1
make: *** [generate] Error 1