Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sticker-maker-wa

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sticker-maker-wa

Easy-to-use sticker maker for WhatsApp.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Sticker Maker

Create WhatsApp stickers from images or videos, with optional metadata embedding for use with Baileys.

Installation

Ensure you have Node.js installed, then install the necessary package:

npm install sticker-maker-wa

Usage

const { createSticker } = require("sticker-maker-wa");
const { readFile } = require("fs/promises");

async function main() {
  const imagePath = "./path/your_image.png";

  const image = await readFile(imagePath);

  const sticker = await createSticker(image, {
    metadata: {
      packname: "Pack Name",
      author: "Author Name",
    },
  });

  socket.sendMessage(jid, { sticker });
}

main();

Animated Sticker Creation

If you are creating animated stickers (video to WebP), make sure you have ffmpeg installed on your system. Here's how to use the createSticker function (also works for static stickers):

npm install ffmpeg-static
const { createSticker } = require("sticker-maker-wa");
const { readFile } = require("fs/promises");
const ffmpegPath = require("ffmpeg-static");

async function main() {
  const videoPath = "./path/your_video.mp4";

  const video = await readFile(videoPath);

  const sticker = await createSticker(video, {
    ffmpeg: ffmpegPath,
    metadata: {
      packname: "Pack Name",
      author: "Author Name",
    },
  });

  socket.sendMessage(jid, { sticker });
}

main();

Function Details

createSticker(input, options)

Parameters
  • input: Buffer | Readable
    • The input file, either an image or a video.
  • options: Object (optional)
    • ffmpeg: string (required in case you want it to be an animated sticker)
    • metadata: Object (optional)
      • packname: string
        • Sticker pack name.
      • author: string
        • Sticker author.
Returns
  • Promise
    • Resolves to a Buffer containing the sticker image in WebP format with embedded metadata (if provided).

Keywords

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc