Configuration
AccessAgent is configured via environment variables and optional adapter plugins.
Environment variables
Section titled “Environment variables”Required
Section titled “Required”| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string. Example: postgresql://user:pass@host:5432/panelai |
OPENAI_API_KEY |
OpenAI API key. Get one from platform.openai.com. |
AUTH_SECRET |
Secret used to sign session tokens. Use a long random string. |
Optional
Section titled “Optional”| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Port the HTTP server listens on |
PROJECTS_DIR |
./projects |
Where per-project widget files are stored |
MAX_PROJECTS_PER_TEAM |
unlimited |
Limit projects per team (set a number to cap) |
AGENT_MODEL |
gpt-4o |
OpenAI model to use for the agent |
AGENT_MAX_TOKENS |
4096 |
Max tokens per agent response |
Auth adapter
Section titled “Auth adapter”By default, AccessAgent uses local username/password authentication. Users register with an email and password stored (hashed) in your database.
To replace auth with a different provider, implement the AuthAdapter interface and pass it to the server config:
import type { AuthAdapter } from '../interface';
export const myAuthAdapter: AuthAdapter = { async createUser(email, password) { ... }, async verifyUser(email, password) { ... }, async getUserById(id) { ... },};Storage adapter
Section titled “Storage adapter”By default, widget files are stored on the local filesystem at ./projects/{projectId}/. For multi-server deployments or cloud storage, implement the StorageAdapter interface:
import type { StorageAdapter } from '../interface';
export const myStorageAdapter: StorageAdapter = { async readFile(projectId, path) { ... }, async writeFile(projectId, path, content) { ... }, async deleteFile(projectId, path) { ... }, async listFiles(projectId) { ... },};Agent model
Section titled “Agent model”The agent uses gpt-4o by default. To use a different model, set AGENT_MODEL:
AGENT_MODEL=gpt-4o-miniAny model accessible via your OpenAI API key will work. gpt-4o produces the best results for code generation. gpt-4o-mini is faster and cheaper but less capable at complex widgets.