Integration guide
Follow these steps in order. Skip optional steps unless you need them.Checklist
Step 1: Install core
Requirements: PHP 8.2+, Laravel 12 or 13, Composer.sv_* tables automatically. No separate Sanvex migrate command.
Optional: production encryption key:
Step 2: Install a driver
github, gmail) must appear in the table.
Driver packages register with Laravel automatically after Composer install. You do not add them to config/sanvex.php unless you built a custom driver class.
Step 3: Configure .env
Open the driver’s Configuration page for exact variable names:
API key drivers (GitHub, Notion internal, Linear, Slack): you can skip OAuth env vars. Store the token in step 4 with
sanvex:setup.
OAuth drivers (Gmail; Notion public integration): set client id, secret, and redirect URI in .env. APP_URL must match your running app and the provider console redirect URL.
config/sanvex.php is optional — only if you want to edit core or driver settings in your app:
Step 4: Connect credentials
Choose one path for your driver.A — API key or bot token (CLI)
B — OAuth (browser)
Built-in login routes (Gmail and Notion today):- Set OAuth env vars (step 3).
- Open the login URL in a browser (same app as
APP_URL). - Approve access at the provider.
- You are redirected back; tokens are stored in
sv_accounts.
oauth()->buildState($owner) — see OAuth.
GitHub, Linear, and Slack do not ship login routes yet — store tokens with sanvex:setup or your own OAuth flow.
Step 5: Verify
github with your driver id. Expect true.
API call:
401, the token is missing or invalid — repeat step 4.
OAuth routes missing? Run php artisan route:list --path=sanvex and confirm login/callback routes exist. If not, check client id env vars (step 3).
Step 6: Agents (optional)
After step 5 succeeds:- Laravel AI —
SanvexAi::driver('github')->tools() - MCP —
php artisan sanvex:mcp-stdio
isConfigured() is true for that driver.
Troubleshooting
Next
- Usage — resources, webhooks, tenancy patterns
- Quickstart — minimal GitHub example
- Installation — same steps with extra notes
- Drivers — per-driver setup and resources
