Skip to content
On this page

Environment Variables

Configuration for the Apex Scholar server. Set these in .env (development) or in your hosting platform’s dashboard (production).


Required for Search Features

VariableWhat it doesHow to get it
SERPAPI_API_KEYEnables Google Scholar searchCreate a free account at serpapi.com
NCBI_API_KEYEnables PubMed searchGet one from your NCBI account

Without these, those search sources are disabled.


Required for LaTeX Compilation

VariableWhat it doesHow to set
GITHUB_TOKENAuth to trigger GitHub Actions workflowCreate a GitHub Personal Access Token with repo scope
GITHUB_OWNERUsername or org that owns the LaTeX workflow repoYour GitHub username (e.g., scholarkit)
GITHUB_REPORepository name containing compile.yml workflowe.g., LaTex

The workflow must accept tex input and output a PDF artifact named pdf with file manuscript.pdf. See LaTeX Workflow for a sample file.


Optional

VariablePurpose
MOONSHOT_API_KEYEnables AI features (insights, file chat)
NODE_ENVdevelopment or production (usually set by platform)
PORTServer port (default 3000)

Security

Never commit .env to version control. Keep it in .gitignore. In production, use the environment variable facilities of your hosting provider (Vercel, Cloudflare Pages, etc.).


For a complete example, see .env.example in the repository.

Questions? Open an issue or join our Discord.