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.
const result = await WPP.group.create('Test Group', ['number@c.us']);
console.log(result.gid.toString()); // Get the group ID
// Get participant result:
console.log(result['number@c.us'].code);
console.log(result['number@c.us'].invite_code);
console.log(result['number@c.us'].invite_code_exp);
console.log(result['number@c.us'].message);
console.log(result['number@c.us'].wid);
const memberResult = result['number@c.us']; // To a variable
// or
const memberResult = Object.values(result)[0]; // Always the first member result
// How to send a custom invite link
const link = 'https://chat.whatsapp.com/' + result['number@c.us'].invite_code;
console.log(link);
// Create a Subgroup for a community
const result = await WPP.group.create('Test Group', ['number@c.us'], 'communit@g.us');
Create a new group
The method return a object with the result of each participant as the key