Official SDKs

Netsware SDK for Node.js and Python

Official client libraries for the Netsware API. Check whether a business is open, get public holidays for 226 countries and territories, schedule jobs that follow business hours and verify webhook signatures, with typed methods instead of hand-written HTTP requests. Free to use under the MIT license.

Node.js

Version 2.2.0 · Node.js 18 or later · No dependencies
$ npm install netsware-sdk

Also available with yarn add netsware-sdk and pnpm add netsware-sdk.

View on npm

Python

Version 2.2.0 · Python 3.8 or later · Standard library only
$ pip install netsware-sdk

Uses only the Python standard library, so nothing else is installed.

View on PyPI

Why use the Netsware SDK

The full Netsware API in idiomatic Node.js and Python, without building requests, parsing responses or writing signature checks yourself.

Install and call in minutes

Install one package, create a client with your API key and make your first request on the next line.

Full TypeScript types

Every method, input and response is typed, so your editor completes field names and flags mistakes before the code runs.

No dependencies

The Node.js SDK uses the built-in fetch API and the Python SDK uses only the standard library. Nothing else is added to your project.

Webhook verification included

One function checks the HMAC-SHA256 signature of every event with a constant-time comparison and rejects deliveries older than five minutes.

Structured errors

Every failed request raises one error type with the HTTP status, a machine-readable error code and a readable message.

Complete API coverage

Business hours, public holidays, one-time, recurring and multi-step jobs, webhooks, groups, variables, run history, metrics and usage.

Quick start

Install the SDK, add an API key and make your first business hours check.

  1. Step 1

    Install the SDK

    Run npm install netsware-sdk for Node.js or pip install netsware-sdk for Python.

  2. Step 2

    Create an API key

    Sign up for free and create a key under Developer, API Keys in the dashboard. Store it in an environment variable, never in source code.

  3. Step 3

    Make your first request

    Check whether a business in India is open right now.

import { Netsware } from 'netsware-sdk';

const client = new Netsware(process.env.NETSWARE_API_KEY);

const status = await client.hours.check({ timezone: 'Asia/Kolkata', country: 'IN' });
console.log(status.isOpen, status.reason, status.nextOpen);
// true 'open' null

The Node.js examples use ES modules. Save them as .mjs files or set "type": "module" in package.json. When the business is closed, reason explains why (after hours, weekend or public holiday) and the response includes the next opening time.

Examples

Working code for the most common tasks, tested against the Netsware API with SDK version 2.2.0.

Get public holidays for any country

Return the public holidays for any of 226 countries and territories in a given year. Add a region code for state and regional calendars.

const result = await client.hours.holidays('DE', 2026);

console.log(result.count);            // how many holidays
for (const h of result.holidays) {
  console.log(h.date, h.name);        // 2026-01-01 New Year's Day ...
}

Run a job only during business hours

Define when a team works, then attach that schedule to a job. If the job comes due outside business hours, on a weekend or on a public holiday, Netsware moves it to the next opening minute instead of firing it.

// 1. When is the team working? Public holidays in Germany count as closed.
const desk = await client.hours.createSchedule({
  name: 'Support desk',
  timezone: 'Europe/Berlin',
  country: 'DE',
  days: ['MON', 'TUE', 'WED', 'THU', 'FRI'],
  openTime: '09:00',
  closeTime: '18:00',
});

// 2. Every 15 minutes, but only while the desk is open.
const sync = await client.jobs.recurring({
  name: 'Sync open tickets',
  url: 'https://example.com/hooks/sync',
  cron: '*/15 * * * *',
  timezone: 'Europe/Berlin',
  businessHoursScheduleId: desk.id,
});

console.log(sync.status, sync.next_run_at);

Schedule a one-time job

Call your URL once at a local time in any timezone. Netsware sends your payload as JSON and logs every attempt.

const reminder = await client.jobs.schedule({
  name: 'Send reminder',
  url: 'https://example.com/hooks/remind',
  runAt: '2027-01-05T09:00:00',   // 9 am in the timezone below
  timezone: 'Asia/Kolkata',
  payload: { userId: '123' },
});

console.log(reminder.run_at_utc); // 2027-01-05T03:30:00.000Z

Manage any job later with pause, resume, trigger (run now), retry, cancel and logs.

Run steps in sequence

A sequence calls several URLs in order, with a delay between steps. Use it for onboarding emails, trial reminders and follow-ups.

const onboarding = await client.jobs.sequence({
  name: 'Onboarding',
  timezone: 'Asia/Kolkata',
  steps: [
    { delay: 0, delayUnit: 'minutes', url: 'https://example.com/hooks/welcome' },
    { delay: 3, delayUnit: 'days', url: 'https://example.com/hooks/tips' },
  ],
});

Keep API tokens out of your code

Store a token once as a secret variable and reference it by name in any job. Netsware inserts the real value only when it calls your URL. Secret values are encrypted and never returned by the dashboard or the API.

await client.variables.set({ name: 'CRM_TOKEN', value: process.env.CRM_TOKEN, isSecret: true });

await client.jobs.recurring({
  name: 'Push to CRM',
  url: 'https://example.com/hooks/crm',
  cron: '0 9 * * MON-FRI',
  timezone: 'Europe/Berlin',
  headers: { Authorization: 'Bearer {{CRM_TOKEN}}' },
});

Receive and verify webhooks

Subscribe a URL to the events you need. Netsware signs every delivery, and one SDK function confirms the signature before you trust the event. Always pass the raw request body, exactly as received.

// Once: subscribe a URL to events. Store the secret, it is shown only once.
const { secret } = await client.webhooks.registerEndpoint({
  url: 'https://example.com/netsware-events',
  events: [{ product: 'scheduled_jobs', event: 'job.failed' }],
});

// In your server (Express shown):
import express from 'express';
import { verifyWebhook } from 'netsware-sdk';

const app = express();
app.post('/netsware-events', express.raw({ type: 'application/json' }), (req, res) => {
  const ok = verifyWebhook({
    payload: req.body.toString('utf8'),
    signature: req.headers['x-netsware-signature'],
    timestamp: req.headers['x-netsware-timestamp'],
    secret: process.env.NETSWARE_WEBHOOK_SECRET,
  });
  if (!ok) return res.status(401).send('Invalid signature');

  const event = JSON.parse(req.body.toString('utf8'));
  // handle the event here
  res.sendStatus(200);
});

Monitor failed runs

List failed runs across all your jobs and send daily totals to your own monitoring.

const failed = await client.runs.list({ status: 'failed', since: '24h' });
console.log(failed.data.length, 'failed runs in the last 24 hours');

const metrics = await client.metrics.get({ window: '7d' });
console.log(metrics.totals.runs);   // { success, failed, timeout, deferred }

const usage = await client.usage.get();
console.log(usage.executions.used, 'of', usage.executions.limit);

Handle errors

Every failed request raises NetswareError with the HTTP status and an error code you can check in code.

import { NetswareError } from 'netsware-sdk';

try {
  await client.hours.check({ timezone: 'Mars/Base', country: 'IN' });
} catch (err) {
  if (err instanceof NetswareError) {
    console.log(err.status, err.code);   // 400 'invalid_timezone'
    console.log(err.message);
  }
}

SDK reference

Both SDKs provide the same modules. Method names follow each language's conventions: createSchedule in Node.js, create_schedule in Python.

PartWhat it doesMain methods
hoursOpen or closed checks, business-hours schedules, public holidayscheck createSchedule checkSchedule updateSchedule setScheduleActive holidays countries
jobsOne-time, recurring and multi-step jobsschedule recurring sequence pause resume trigger logs run
webhooksSend events to your URL, test them, see deliveriesregisterEndpoint testEndpoint endpointDeliveries
verifyWebhookConfirm an incoming event really came from NetswareverifyWebhook / verify_webhook
groupsOrganize jobs into folderscreate rename list delete
variablesReusable values and encrypted secrets for your jobsset list
runsFailed or delayed runs across your whole accountlist
metricsDaily totals for your own dashboardsget
usageThis month's usage against your limitsget

Settings

Both SDKs connect to https://app.netsware.com with a 30-second request timeout. Change either when you create the client: { baseUrl, timeoutMs: 10000 } in Node.js, or base_url and timeout=10 in Python.

Other languages

Netsware is a standard REST API, so Go, PHP, Ruby, Java and any other language can call it with a regular HTTP client. Start with the API reference, the OpenAPI specification and the llms.txt guide for AI coding assistants.

Common questions

Is the Netsware SDK free?

Yes. Both SDKs are free to use under the MIT license. You need a Netsware account and an API key, and the Essentials plan is free.

Do I need the SDK to use the Netsware API?

No. Any language with an HTTP client can call the REST API directly. The SDKs remove the request code, add TypeScript types and include webhook signature verification.

Which Node.js and Python versions are supported?

Node.js 18 or later, and Python 3.8 or later.

Can I use the Netsware SDK in a browser?

No. Keep your API key on the server and call Netsware from your backend, a serverless function or a script. Code that runs in a browser exposes the key to anyone who opens the page.

How do I get a Netsware API key?

Sign up for free and create a key under Developer, API Keys in the dashboard. The key is shown only once, so copy it to a safe place.

How do I verify Netsware webhook signatures?

Call verifyWebhook in Node.js or verify_webhook in Python with the raw request body, the X-Netsware-Signature and X-Netsware-Timestamp headers and your endpoint secret. It returns false for an invalid signature or a delivery older than five minutes.

Does the SDK work with AI coding assistants?

Yes. Point your assistant to the Netsware llms.txt guide and it can write correct code for either SDK.

Start building with Netsware

Free plan, no credit card. Create your API key in under a minute.