Edge Functions
Supabase Edge Functions let you run server-side code securely. Cadrant uses them to integrate external APIs, process payments, send emails and any logic that shouldn't be exposed client-side.
Common use cases
- Payment integrations (Stripe, PayPal, etc.).
- Transactional emails (Resend, SendGrid, etc.).
- AI API calls (OpenAI, Anthropic, etc.).
- Webhooks and notifications to third-party services (Slack, CRM, etc.).
- Any logic requiring secret API keys.
How it works
- Describe the desired integration in your prompt (e.g.: 'Add Stripe payment for subscriptions').
- Cadrant generates the Edge Function code and deploys it to your Supabase project.
- Sensitive API keys are stored in environment variables, never in frontend code.
- The frontend application calls the Edge Function securely via the Supabase API.
Security
- Edge Functions run in an isolated environment on Supabase servers.
- API keys and secrets are never exposed to the user's browser.
- Add your environment variables in the Database > Environment panel of your project.
- Functions can verify user authentication before executing business logic.
Tip: if you're using an external service (Stripe, OpenAI, etc.), create an account with that service and get your API keys before asking Cadrant for the integration.