tsp-scale-sdk
v1.1.0
Published
Official Node.js client for TSP Scale Email and WhatsApp API
Maintainers
Readme
tsp-scale-sdk
Official Node.js SDK for TSP Scale.
Install
npm install tsp-scale-sdkUsage
const { TspScaleClient } = require("tsp-scale-sdk");
const client = new TspScaleClient({
apiKey: process.env.TSP_API_KEY,
baseUrl: "https://api.tspscale.in/api/v1",
});
async function run() {
const result = await client.sendEmail({
from: "[email protected]",
to: "[email protected]",
subject: "Hello from TSP Scale",
html: "<h1>It works</h1>",
});
console.log(result);
}
run().catch(console.error);WhatsApp Messaging
const { TspScaleClient } = require("tsp-scale-sdk");
const client = new TspScaleClient({
apiKey: process.env.TSP_API_KEY
});
async function run() {
const result = await client.sendWhatsApp({
to: "919988776655",
text: "Hello from TSP Scale!",
// mediaUrl: "https://example.com/image.jpg" // Optional
});
console.log(result);
}
run().catch(console.error);Notes
- The SDK automatically adds signed security headers required by the
/emails/sendAPI. - Direct calls to
/emails/sendwithout SDK signature headers are rejected by the backend.
