Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs]: Incomplete setup instructions for running the Unkey API locally #2898

Open
Nelwhix opened this issue Feb 15, 2025 · 1 comment
Open
Labels
Documentation Improvements or additions to documentation Needs Approval Needs approval from Unkey

Comments

@Nelwhix
Copy link
Contributor

Nelwhix commented Feb 15, 2025

Type of documentation issue

Missing Information

Describe the problem and the proposed solution

On https://www.unkey.com/docs/contributing/getting-started. After following up the steps to set up the api and run it, I got this error when I made a request:

{
  "message": "BAD_ENVIRONMENT",
  "errors": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": ["AGENT_URL"],
      "message": "Required"
    },
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": ["AGENT_TOKEN"],
      "message": "Required"
    },
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": ["CLICKHOUSE_URL"],
      "message": "Required"
    }
  ]
}

so the API section should have

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_....
AGENT_URL="http://localhost:8080"
AGENT_TOKEN="agent-auth-secret"
CLICKHOUSE_URL="http://default:password@localhost:8123"

This seems obvious in hind-sight, but I was stuck at first on what key to use as my bearer token. So maybe I could add a section in the docs explaining that. Also apps/api/.dev.vars.example should be updated with the AGENT_URL, AGENT_TOKEN and CLICKHOUSE_URL variables.

If you think this is a good change, I can start working on a fix immediately.

@Nelwhix Nelwhix added Documentation Improvements or additions to documentation Needs Approval Needs approval from Unkey labels Feb 15, 2025
Copy link

linear bot commented Feb 15, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Needs Approval Needs approval from Unkey
Projects
None yet
Development

No branches or pull requests

1 participant