How to build a WhatsApp AI assistant

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • whatsapp-web.js

    A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app

  • Node.js WhatsApp API - Since WhatsApp only offers an API for business accounts that requires multiple verification and review steps to get access, we’ll put together our own API using the whatsapp-web.js library. It will forward user messages to our API and send responses from the assistant to the user.

  • zod

    TypeScript-first schema validation with static type inference

  • Zod, a popular typescript schema validation library that will let us define the shape of the payload sent to our background job.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • trigger-dev-whatsapp-api

    Example WhatsApp API

  • WhatsApp Node.js API

  • trigger-dev-hono-api

    Hono API for trigger.dev WhatsApp assistant

  • Hono API

  • puppeteer

    Node.js API for Chrome

  • This library works by creating an instance of WhatsApp web running inside an instance of headless chrome automated by puppeteer. In my testing, I ran into tons of compatibility issues when trying to use these dependencies inside anything other than a bare-bones Node.js + express server. Also, we can’t spin up a new instance of chrome and WhatsApp web each time a user sends a message, this will exhaust our allowed WhatsApp connections (4 max), not to mention that doing this will make the response times painfully slow.

  • ngrok

    Expose your localhost to the web. Node wrapper for ngrok. (by bubenshchykov)

  • We need to make our WhatsApp API accessible on the internet so the trigger.dev cloud service can connect to it. We can do that by running ngrok in a separate terminal.

  • hono

    Web Framework built on Web Standards

  • Initialize your hono project using bun:

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts