Wa-Sticker-Formatter v4.4.4 is a Node.js library for creating WhatsApp stickers from images, GIFs, videos, SVG strings, or buffers. It produces WebP files and integrates with Baileys via `toMessage()`. Active development, TypeScript-first with full type definitions. Supports pack/author metadata, emoji categories, background color, cropping/background-fill types, and quality control. CommonJS and ESM compatible, but ESM is recommended for modern projects.
npm install wa-sticker-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WhatsApp sticker from a local image file with custom pack name, author, type, categories, quality, and background color.
Ensure the input is one of: Buffer (image/gif/video), SVG string, URL, or file path to such a file.
Use `new Sticker(buffer, options)` or chain `new Sticker(buffer).setPack('...')` etc.Use `StickerTypes.CROP` or `StickerTypes.FULL` (enum), or the exact strings 'crop' / 'full'.
Install sharp: `npm install sharp`
Set `type: StickerTypes.FULL` if you need a background color.
Use `toBuffer()` or `toFile()` if not using Baileys.
Use `import { Sticker } from 'wa-sticker-formatter'` for types, or use `// @ts-ignore` for require.Ensure the file exists and the path is correct. Use absolute paths or resolve relative paths with `path.resolve()`.
Check the input format. Must be one of: jpeg, png, gif, webp, svg, mp4. For videos, ensure sharp is installed.
Run `npm install sharp` to install sharp.
Use `new Sticker(...)` instead of `Sticker(...)`.