The Brevo CLI handles app creation, credential management, and local testing. This quickstart walks through the fastest path to a working OAuth flow.
The CLI prompts you to choose between browser sign-in (default) and API key. Browser sign-in opens oauth-cli.brevo.com — credentials are saved to ~/.brevo/credentials.json.
For non-interactive environments (CI/CD), set the BREVO_API_KEY environment
variable instead of running brevo login.
The guided setup prompts for an app name, distribution type, OAuth callback URL, and whether to scaffold starter code. Use http://localhost:3009/auth/callback as your callback URL for local development.
Your client_id and client_secret are written to src/oauth/.env.local
automatically. This file is gitignored — never commit it.
Install the test server’s dependencies, then start it:
Your browser opens at http://localhost:3009. Click Start OAuth Flow, sign in with a Brevo account, and your tokens appear masked in the browser — click to reveal them.
If the port you’re using isn’t registered as a redirect URL on your app, the CLI will prompt you to add it automatically. Approve to continue — it updates your app and app-config.json in one step.
brevo app init did three things:
client_id and client_secretsrc/oauth/.env.local (gitignored, chmod 600)GET /auth/login — builds the authorization URL and redirects to oauth.brevo.comGET /auth/callback — validates state, exchanges the authorization code for tokensGET /auth/refresh — exchanges the refresh token for a new access tokenThis server is a reference implementation for local testing. To implement OAuth in your real application, follow the Integration guide.
Works out of the box with AI coding tools. The scaffold includes CLAUDE.md (for Claude Code) and AGENTS.md (for GitHub Copilot, Cursor, and similar tools), pre-populated with the OAuth flow, endpoint reference, and how to run the server. Open the project in your editor and your AI assistant understands it without extra context.
See the CLI reference for all commands and flags.