The Node.js SDK re-exports the WAJS namespace for TypeScript. This reference describes types from WA-JS 4.8.5-rc.0. For operations available on a connected Node.js client, see Whatsapp. For functions running inside WhatsApp Web, see the WA-JS browser API.
Optionallink// Automatic detection
WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8');
// Overriding the title and description
WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8', {
linkPreview: {
title: 'Another text',
description: 'Another description'
}
});
Send text message with link preview