Connect with Cloudflare Workers
Use a Worker to validate and forward submissions at the edge.
Requirements
Create a Worker POST handler and add PANTHER_HOOK_TOKEN as a Worker secret through your deployment environment.
Protected ingestion uses POST /api/v1/forms/:formId/submissions with Authorization: Bearer and submissions:create scope.
Configure and test
Step 1: Copy credentials or form key
Create a scoped workspace token in API Tokens and store it in the server or hosting platform secret store.
Step 2: Add the request
This is a trusted proxy. Validate request origin, size and fields, enforce abuse controls, and return the upstream response instead of exposing credentials.
Step 3: Send a test
Use test: true in the JSON request or run the form setup test tool.
Step 4: Verify and launch
Open Submissions and filter by Test to verify captured field values. Configure enabled destinations and inspect Deliveries separately.
Example
This Cloudflare Workers example uses standard HTTP. Panther Hook does not require a framework-specific SDK; replace all placeholder identifiers with real form values.
export default {
async fetch(request, env) {
if (request.method !== 'POST') return new Response('Method not allowed', { status: 405 });
const lead = await request.json(); // Validate fields before forwarding.
const upstream = await fetch(
'https://pantherhook.com/api/v1/forms/YOUR_FORM_ID/submissions', {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + env.PANTHER_HOOK_TOKEN },
body: JSON.stringify(lead),
});
return new Response(upstream.body, { status: upstream.status,
headers: { 'Content-Type': 'application/json' } });
},
};Troubleshoot
- Unexpected 4xx: check endpoint, scope or allowed origin and required fields.
- 429: respect rate limits and avoid unbounded retries.
- Accepted lead but missing notification: inspect the relevant destination and spam classification separately.
