Concepts

Vartiq has three main concepts:
  • Apps represents your customer. Create one app per customer.
  • Webhooks are the URLs that receive the webhooks. Each app can have multiple webhooks.
  • Messages are the the data that is sent to the webhooks.

Install the SDK

npm i vartiq
// or
bun add vartiq
// or
pnpm add vartiq

Get the API Key

Get the API key from the Vartiq dashboard. api-key

Get the project ID

You can have multiple projects in your account. Get the project ID from the project settings projects

Initialize the SDK

import { Vartiq } from 'vartiq';

const vartiq = new Vartiq("YOUR_API_KEY");

Creating an App

const app = await vartiq.app.create({
  name: "App name", // setting this to the name or id of your customer is recommended
  projectId: "PROJECT_ID",
});

Creating a Webhook

const webhook = await vartiq.webhook.create({
  url: "https://example.com",
  appId: "APP_ID",
  customHeaders: [{ key: "x-app", value: "x-value" }], // optional
});

Sending a Message

Sending a message to a app(your customer) will send the message to all the webhooks associated with the app.
const message = await vartiq.webhook.message.create("APP_ID", { 
    hello: "world" 
});
https://mintlify.b-cdn.net/v6.6.0/lucide/text.svg

Have questions or need help with Vartiq?

Schedule a quick call with our team to get personalized support, feature walkthroughs, or technical guidance.