charanjit-singh/lovable-skills/edge-functions-and-webhooks
- community
Checking that the SKILL.md file is still in the repository.
Use when adding Supabase Edge Functions, Stripe/webhook handlers, server-side secrets, or API routes that must not run in the browser. Not for client-only UI, CSS, or simple CRUD that RLS + client can handle safely.
Install
npx vskill@latest install charanjit-singh/lovable-skills/edge-functions-and-webhooksSKILL.md
Edge functions and webhooks
Secrets and trusted third-party callbacks belong in Supabase Edge Functions (or equivalent server), never in the Vite client bundle.
When to use an edge function
- Webhook signature verification (Stripe, etc.).
- Operations requiring service role or private API keys.
- Sending email with provider API keys.
- Complex server logic that must not be tampered with client-side.
Structure
- Read secrets from
Deno.env.get("STRIPE_WEBHOOK_SECRET")etc. — set in Supabase dashboard, not in repo. - Return proper HTTP status:
400invalid payload,401bad signature,200success. - Make webhook handlers idempotent (store processed event IDs).
Stripe webhook pattern
- Verify signature with raw body + secret.
- Switch on
event.type; update DB with service client. - Respond quickly; heavy work async if needed.
For full Stripe event matrix, idempotency, and testing, use `stripe-payment-webhooks`, `payment-webhook-idempotency`, and `payment-webhook-testing`.
Client invocation
- Use
supabase.functions.invoke("send-email", { body: { ... } })only for operations safe for authenticated users. - Pass JWT; validate
auth.getUser()inside the function for user-triggered calls.
Avoid
VITE_STRIPE_SECRET_KEY,VITE_SERVICE_ROLE, or webhook secrets in frontend.- Trusting client-sent payment status without webhook confirmation.
- Logging full webhook payloads with PII in production.
Required companion skills
For any non-trivial edge function, also apply:
server-input-validation— Zod on every bodyapi-error-handling— consistent JSON errors and status codes
Checklist
- [ ] CORS configured only if browser calls the function.
- [ ] Auth or signature verified on every entry point.
- [ ] Body validated with Zod (
server-input-validation). - [ ] Errors returned as JSON with stable codes (
api-error-handling). - [ ] Secrets via
Deno.env.get(...); never logged.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/edge-functions-and-webhooks/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/charanjit-singh/lovable-skills/edge-functions-and-webhooks)