Content Deep Dive
How to Send a vCard with Twilio WhatsApp and Node.js
Blog post from Twilio
Post Details
Company
Date Published
Author
Dhruv Patel
Word Count
1,497
Language
English
Hacker News Points
-
Summary
To create and send vCards through the WhatsApp Business API using Node.js, you need to set up your Twilio number with WhatsApp, install dependencies, host a static directory for your vCard file, build the vCard, and then send it via a WhatsApp message. You can use ngrok to expose a public URL for your vCard file and store environment variables in a .env file to access your Twilio credentials. The process involves creating a contact card using the vcards-js package, saving it to a local file, and then sending it through the Twilio SDK as a media message. You can customize your vCard with different properties and send it to WhatsApp users who have sent you a message within the past 24 hours.