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

@shibacore/apis

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shibacore/apis - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "@shibacore/apis",
"version": "1.0.5",
"version": "1.0.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "./build/index.js",

@@ -13,8 +13,8 @@ # Whatsapp Messages API

- [API Reference](#api-reference)
- [WhatsappMessages](#whatsappmessages)
- [Message Types](#message-types)
<!--
- [WhatsappMessages](#whatsappmessages) - [Message Types](#message-types)
<!--
- [Error Handling](#error-handling)
--->
--->
- [License](#license)
---

@@ -27,9 +27,12 @@

```
---
## Features
- Easily send WhatsApp messages using the Graph API.
- Supports text, media (images, videos), templates, interactive components (buttons, lists), and location messages.
- Customizable headers and token types for enhanced flexibility.
- Robust error handling with well-structured responses.
- Easily send WhatsApp messages using the Graph API.
- Supports text, media (images, videos), templates, interactive components (buttons, lists), and location messages.
- Customizable headers and token types for enhanced flexibility.
- Robust error handling with well-structured responses.
---

@@ -41,5 +44,5 @@

1. A valid access token for the WhatsApp Business API.
2. Your WhatsApp Business phone number ID.
3. A registered app on the <a href="https://developers.facebook.com/">Facebook Developer Dashboard</a>.
1. A valid access token for the WhatsApp Business API.
2. Your WhatsApp Business phone number ID.
3. A registered app on the <a href="https://developers.facebook.com/" target="_blank">Facebook Developer Dashboard</a>.

@@ -49,12 +52,14 @@ ## Example Usage

import { WhatsappMessages } from "@shibacore/apis";
const accessToken = "your-access-token";
const phoneNumberId = "your-phone-number-id";
const apiVersion = "v20.0";
const whatsapp = new WhatsappMessages(accessToken, apiVersion, phoneNumberId);
const whatsapp =
new WhatsappMessages(accessToken, apiVersion, phoneNumberId);
// Send a text message
(async () => {
const response = await whatsapp.text("recipient-phone-number", "Hello, World!");
const response =
await whatsapp.text("recipient-phone-number", "Hello, World!");
console.log(response);

@@ -64,2 +69,3 @@ })();

---
## API Reference

@@ -70,4 +76,4 @@

Provides methods to send different types of WhatsApp messages.
Constructor
Constructor
constructor(

@@ -84,4 +90,6 @@ access_token: string,

## Message Types
1. Template Messages
1. Template Messages
async template(

@@ -94,40 +102,44 @@ to: string,

- Sends a WhatsApp template message.
Example:
- Sends a WhatsApp template message.
await whatsapp.template("recipient-phone-number", "hello_world", "en_US");
Example:
2. Text Messages
await whatsapp
.template("recipient-phone-number", "hello_world", "en_US");
async text(
to: string,
bodyText: string,
preview_url?: boolean
): Promise<WhatsappMessageResponse>;
2. Text Messages
- Sends a plain text message.
async text(
to: string,
bodyText: string,
preview_url?: boolean
): Promise<WhatsappMessageResponse>;
- Sends a plain text message.
Example:
await whatsapp.text("recipient-phone-number", "Hello, this is a message!");
await whatsapp
.text("recipient-phone-number", "Hello, this is a message!");
3. Media Messages
3. Media Messages
- Image
async image(
to: string,
imageOption: Media
): Promise<WhatsappMessageResponse>;
async image(
to: string,
imageOption: Media
): Promise<WhatsappMessageResponse>;
- Video
async video(
to: string,
videoOption: Media
): Promise<WhatsappMessageResponse>;
async video(
to: string,
videoOption: Media
): Promise<WhatsappMessageResponse>;
Example:
Example:
await whatsapp.image("recipient-phone-number", { id: "media-id" });
await whatsapp
.image("recipient-phone-number", { id: "media-id" });

@@ -158,19 +170,18 @@ <!--

4. Location Messages
4. Location Messages
async location(
to: string,
location: Location
): Promise<WhatsappMessageResponse>;
async location(
to: string,
location: Location
): Promise<WhatsappMessageResponse>;
Example:
Example:
await whatsapp.location("recipient-phone-number", {
latitude: "12.34",
longitude: "56.78",
name: "Location Name",
address: "123 Address St."
});
await whatsapp.location("recipient-phone-number", {
latitude: "12.34",
longitude: "56.78",
name: "Location Name",
address: "123 Address St."
});
---

@@ -182,4 +193,4 @@

### Key Features of the Document:
### Key Features of the Document:
1. **Installation & Prerequisites**: Details on setting up the library.

@@ -191,4 +202,3 @@ 2. **Features & Examples**: Highlights key functionalities with code samples.

5. **Contributing & License**: Guidelines for contributing to the project.
--->
This `README.md` ensures clarity and usability for users integrating your library.
--->
This `README.md` ensures clarity and usability for users integrating your library.
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