HighLevel Integrations
HighLevel (LeadConnector; white-labelled at crm.fortadams.org) is the CRM. The site integrates with it in four independent ways:
| Integration | Mechanism | Code |
|---|---|---|
| Event inquiries | Server-side API calls from a Pages Function | functions/api/event-inquiry.ts, components/host/EventInquiryForm.tsx |
| Volunteer / corporate / newsletter leads | Browser no-cors POST to inbound webhooks |
components/support/LeadForm.tsx, components/events/EmailSignup.tsx |
| Donations | Link to a hosted form | components/support/DonateWidget.tsx |
| Memberships | Links to hosted recurring payment links | lib/support-content.ts, components/support/MembershipTiers.tsx |
1. Event inquiry Pages Function
POST /api/event-inquiry (same origin). The browser sends JSON:
{ "firstName": "", "lastName": "", "email": "", "phone": "", "company": "",
"eventType": "", "guestCount": "", "budget": "", "preferredDate": "", "message": "" }
The function then:
- Origin check. If an
Originheader is present and differs from the request's origin →403. - Config check. If any required secret is missing →
503 "Event inquiry service is not configured." - Validation. It trims all strings. Missing
firstName,lastName,email, oreventType→400. - Contact upsert.
POST https://services.leadconnectorhq.com/contacts/upsert, headersAuthorization: Bearer <token>andVersion: v3, withlocationId, names, email, phone,companyName,source: "Website — Event Inquiry", andtags: ["Event Inquiry","Website"]. The contact ID is read fromidorcontact.id. On failure →502. - Opportunity.
POST /opportunities/withpipelineId,pipelineStageId,contactId,name: "Event Inquiry — {First Last} ({eventType})",status: "open", the source,monetaryValuefrom the budget map, and optionalcustomFields([{id, fieldValue}], included only for configured IDs with non-empty values). On failure →502. - Returns
200 {"success": true}withCache-Control: no-store.
The form shows its confirmation only on response.ok && success === true.
Secrets (Cloudflare Pages → Settings → Variables and Secrets, encrypted, for Production and Preview):
| Name | Required |
|---|---|
GHL_PRIVATE_INTEGRATION_TOKEN |
Yes. A Private Integration token with contacts and opportunities write scopes. |
GHL_LOCATION_ID |
Yes |
GHL_EVENTS_PIPELINE_ID |
Yes |
GHL_EVENTS_PIPELINE_STAGE_ID |
Yes |
GHL_EVENT_TYPE_FIELD_ID, GHL_EVENT_GUEST_COUNT_FIELD_ID, GHL_EVENT_BUDGET_FIELD_ID, GHL_EVENT_DATE_FIELD_ID, GHL_EVENT_MESSAGE_FIELD_ID |
Optional opportunity custom-field IDs |
The budget-to-value map is duplicated. budgetOptions in src/lib/host-content.ts provides the dropdown labels, and budgetValues in functions/api/event-inquiry.ts maps those labels to numbers. If you change a label in one place, change the other, or the value silently becomes 0.
Hardening gaps: there's no CAPTCHA, honeypot, or rate limiting, and a request without an Origin header (a non-browser client) passes the origin check. If spam appears, add Cloudflare Turnstile verification in the function, or a WAF rate-limit rule on /api/event-inquiry.
2. Webhook lead forms
LeadForm (configured per use in support-us/page.tsx) and EmailSignup POST JSON as text/plain with mode: "no-cors". That makes the request CORS-simple, but the response is opaque: the browser can't read the status. Payloads:
- LeadForm: every field value, plus
name,source,tags,opportunityName("<prefix> — <name>"), andsubmittedAt. The corporate form addscompanyName. - EmailSignup:
email,source: "Website — Events Newsletter",tags: ["Newsletter","Website"],submittedAt.
Env vars (public, baked into the build): NEXT_PUBLIC_VOLUNTEER_WEBHOOK_URL, NEXT_PUBLIC_CORPORATE_WEBHOOK_URL, NEXT_PUBLIC_NEWSLETTER_WEBHOOK_URL. A URL is treated as "ready" only if it starts with http(s):// and doesn't contain example.com.
If a webhook URL isn't ready, the form waits 500 ms and shows success without sending anything. Even when it is ready, success is shown whatever HighLevel returns. Confirm the production values in Cloudflare, and consider moving these forms behind a Pages Function like the event inquiry so failures are visible.
HighLevel side: create one inbound-webhook workflow per form, map the fields to the contact and opportunity, and route to the volunteer or corporate/sponsorship pipeline.
3. Donations
DonateWidget links to the hosted Web Donation form https://crm.fortadams.org/widget/form/okXo0SaqzMNahWJzB1YZ. There's no iframe, embed script, or amount prefill, because prefill wasn't verified for this form. The old NEXT_PUBLIC_DONATION_PROVIDER and NEXT_PUBLIC_DONATION_EMBED_CONFIG variables are obsolete and can be deleted from Cloudflare. The CRM-side checklist (matching, designations, receipts, refunds, testing) is in Administrator Guide → Donations and Memberships.
DafPanel embeds NEXT_PUBLIC_DAF_WIDGET_URL in an iframe when set (Chariot/DAFpay style). Otherwise it shows the legal name, EIN, and address from siteConfig.org.
4. Memberships
membershipTiers in src/lib/support-content.ts. Each tier has a joinUrl of https://crm.fortadams.org/payment-link/<id>:
| Tier | Price | Payment link ID |
|---|---|---|
| Individual | $50 | 6a033d0c8c3f15f97515abb9 |
| Family | $75 | 6a033d5f1d5a394a682e43a6 |
| Patron | $500 | 6a033d291d5a394a682e43a4 |
| Benefactor | $1,000 | 6a033d438c3f15f97515abbb |
These are public identifiers, not credentials. Each points to a HighLevel recurring product. The first successful payment creates the contact and the subscription natively. Don't create subscriptions via the API: HighLevel's API can only list and get subscriptions, and creating one would duplicate it. isJoinable() disables the button ("Online membership opens soon") for a non-http or example.com URL. Setting featured: true on a tier adds a "Most popular" badge and brass styling.