const { Suprsend } = require("@suprsend/node-sdk");
const supr_client = new Suprsend("workspace_key", "workspace_secret")
const tenant_payload = {...} // prepare tenant datastructure payload
// ---- Optional Parameters -------
const requestData = {
secondary_color: "#00ff00",
tertiary_color: "#0000ff",
timezone: "America/New_York",
// blocked channels will be skipped triggering notifications for this tenant.
blocked_channels: ["email"],
social_links: {
website: "https://suprsend.com",
facebook: "",
linkedin: "",
twitter: "",
instagram: "",
medium: "",
discord: "",
telegram: "",
youtube: ""
},
// In-product Notification center link for capturing user preferences.
embedded_preference_url: "",
properties: {
prop1: "value1",
prop2: { prop3: ["value2"] }
}
};
// create or update tenant
const response = supr_client.tenants.upsert(tenant_id, tenant_payload);
response.then((res) => console.log("response", res));