Add LLM Spam Check to Newsletter Signup Before HubSpot Submission (Next.js)

Posted 3 days ago

Only freelancers located in the U.S. may apply.U.S. located freelancers only

Summary

Overview I have a Next.js website with a newsletter signup form that currently submits directly from the browser to HubSpot's Forms v3 endpoint. I want to add a lightweight LLM-based spam filter that inspects each submission *before* it reaches HubSpot, and silently rejects (or flags) anything that looks like spam/bot/junk input. Current setup - Framework: Next.js (App Router, TypeScript, React client component) - The form component (`NewsletterForm.tsx`) POSTs directly to `https://api.hsforms.com/submissions/v3/integration/submit/[portalId]/[formGuid]` - Fields collected: `firstname`, `lastname` (optional), `jobtitle`, `email` - Portal ID and Form GUID are public form identifiers (no secrets today) What I want you to build 1. Create a server-side API route in the Next.js app (e.g. `app/api/subscribe/route.ts`) that: - Receives the form fields from the client - Runs an LLM spam/quality check (e.g. OpenAI or similar) to classify the submission as legit vs. spam — checking for gibberish names, fake/disposable emails, nonsense job titles, injection attempts, etc. - If legit → forwards the submission to HubSpot (server-side) - If spam → rejects gracefully with a generic message (no HubSpot write) 2. Update the existing `NewsletterForm.tsx` to POST to the new internal API route instead of calling HubSpot directly. 3. Keep the LLM API key server-side only (use an environment variable — never expose it to the client). 4. Preserve the existing UX: loading / success / error states should still work. Deliverables - Working API route with the LLM spam check + HubSpot forwarding - Updated form component - Brief note on which env vars to set (`OPENAI_API_KEY`, etc.) and how to configure them - Clean, typed TypeScript that matches the existing code style Nice to have (optional) - Basic rate limiting / honeypot field as a cheap first line of defense before the LLM call - Configurable spam threshold or a logged "reason" when something is rejected Requirements to apply - Strong Next.js App Router + TypeScript experience - Experience calling an LLM API (OpenAI or equivalent) from a server route - Familiarity with HubSpot Forms API is a plus To apply, please briefly answer: 1. Which LLM/provider would you use and roughly what would it cost per submission? 2. How would you handle the case where the LLM API is slow or down — do you fail open (let it through) or fail closed (block it)? 3. Have you integrated with HubSpot Forms before? (yes/no is fine)

  • Less than 30 hrs/week
    Hourly
  • < 1 month
    Duration
  • Expert
    Experience Level
  • $100.00

    -

    $120.00

    Hourly
  • Remote Job
  • One-time project
    Project Type
Skills and Expertise
Mandatory skills
JavaScript
Web Development
Activity on this job
  • Proposals:50+
  • Last viewed by client:3 days ago
  • Hires:
    1
  • Interviewing:
    1
  • Invites sent:
    2
  • Unanswered invites:
    0
About the client
Member since Jun 29, 2026
  • United States
    Lathrop12:31 PM
  • 1 hire, 0 active
  • 1 hour
  • Tech & IT
    Small company (2-9 people)

Explore similar jobs on Upwork

HTML
Microsoft Outlook
Office 365
HTML5
Front-End Development
Responsive Design
Wix
Web Development
Information Architecture
UX & UI Design

How it works

  • Post a job icon
    Create your free profile
    Highlight your skills and experience, show your portfolio, and set your ideal pay rate.
  • Talent comes to you icon
    Work the way you want
    Apply for jobs, create easy-to-by projects, or access exclusive opportunities that come to you.
  • Payment simplified icon
    Get paid securely
    From contract to payment, we help you work safely and get paid securely.
Want to get started? Create a profile

About Upwork

  • Rating is 4.9 out of 5.
    4.9/5
    (Average rating of clients by professionals)
  • G2 2021
    #1 freelance platform
  • 49,000+
    Signed contract every week
  • $2.3B
    Freelancers earned on Upwork in 2020

Find the best freelance jobs

Growing your career is as easy as creating a free profile and finding work like this that fits your skills.

Trusted by

  • Microsoft Logo
  • Airbnb Logo
  • Bissell Logo
  • GoDaddy Logo