Skip to content

wotzebra/my247-api

Repository files navigation

MY247 API - Webflow to Salesforce Integration

Secure API middleware for handling form submissions from Webflow and creating leads in Salesforce.

Setup

  1. Install dependencies:

    npm install
  2. For local development:

    # Copy the example environment file
    cp .dev.vars.example .dev.vars
    
    # Edit .dev.vars with your actual Salesforce credentials
    nano .dev.vars
    
    # Start local development server
    npm run dev
  3. For production deployment:

    # Set up Salesforce secrets in Cloudflare Workers
    wrangler secret put SALESFORCE_CLIENT_ID
    wrangler secret put SALESFORCE_CLIENT_SECRET
    wrangler secret put SALESFORCE_USERNAME
    wrangler secret put SALESFORCE_PASSWORD
    wrangler secret put SALESFORCE_SECURITY_TOKEN
    
    # Deploy to Cloudflare
    npm run deploy

API Endpoints

  • POST /api/forms/individual - Individual customer registration
  • POST /api/forms/organization - Organization customer registration
  • POST /api/forms/referral - Referral registration

Documentation

  • GET /docs - Interactive Swagger UI documentation
  • GET /docs/spec.json - OpenAPI specification JSON

Security Features

  • Credentials stored as Cloudflare Workers secrets
  • Input validation and sanitization
  • CORS protection
  • Rate limiting via Cloudflare
  • No sensitive data logged

Form Field Mapping

Individual Form

  • firstName/voornaam → Lead.FirstName
  • lastName/achternaam → Lead.LastName
  • email → Lead.Email
  • phone/telefoon → Lead.Phone
  • Additional address and preference fields

Organization Form

  • Contact person details → Lead fields
  • organizationName/naamOrganisatie → Lead.Company

Referral Form

  • Similar to individual with referral tracking

About

Secure API middleware for Webflow to Salesforce integration using Cloudflare Workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published