Web & Node.js SDK

Integrate waitlists, feedback forms, support triaging, and cancellation deflection statefully into your Javascript/Typescript web apps and backend servers.

1. Installation

Add the AppMate Javascript SDK to your Node.js backend, React/Next.js client-side flow, or standard web application using your preferred package manager:

bash
npm install @fil-technology/appmate-js

Or if you are using PNPM or Yarn:

bash
pnpm add @fil-technology/appmate-js

2. Initialization

Initialize the client with your secret Bearer API key. You can generate a bearer token in your AppMate dashboard under Settings → API tokens:

typescript
import { AppMate } from "@fil-technology/appmate-js";

const appmate = new AppMate({
  token: "amk_dev_7x29p..." // Your API token
});

3. Waitlist Signups

Collect subscriber emails from custom marketing headers, newsletter signups, or custom forms statefully using your API context:

typescript
await appmate.waitlists.addSignup({
  appId: "app_clx72a9...",
  email: "subscriber@domain.com",
  source: "saas_footer_newsletter",
  attributes: {
    interestedPlan: "pro_annual",
    preferredRegion: "eu-west-1"
  }
});

4. Feedback & Bug Reports

Gather in-app NPS surveys, suggestions, or route structured bug triage reports from your web dashboard without building a database or email routing backend:

typescript
// 1. Submit NPS / suggestion feedback
await appmate.feedback.submit({
  appId: "app_clx72a9...",
  rating: 5,
  message: "Integrating the MCP server with Cursor was stupidly simple!",
  email: "developer@startup.io",
  source: "in_app_modal"
});

// 2. Submit bug triage logs
await appmate.reports.submit({
  appId: "app_clx72a9...",
  category: "ui_bug",
  message: "Horizontal overflow on Safari mobile portrait mode",
  email: "qa-team@startup.io",
  source: "web_widget"
});

5. Stateful Cancellation Deflection

Bring AppMate's primary retention powers to your web-based SaaS apps. Instead of letting active accounts cancel instantly, boot up a stateful session to chronologically record their choice path and deflect churn with tailored offers:

typescript
// 1. Start a stateful cancellation session
const session = await appmate.cancellation.createSession({
  appId: "app_clx72a9...",
  userId: "usr_94a2b8e",
  platform: "web"
});

console.log(`Session initialized: ${session.id}`); // sess_9x72a...

// 2. Present exit reasons, then record their selected choice
const deflection = await session.selectReason("too_expensive");

// 3. Inspect the rescue deflection action configured in your cloud dashboard
if (deflection.action === "offer") {
  // Apply a dynamic discount code (e.g. 20% off for 3 months)
  applySaaSPromotion(deflection.metadata.offerId);
  await session.complete({ status: "saved" });
  
} else if (deflection.action === "support") {
  // Route to support chat or triage dialogue
  openTriageWidget();
  await session.complete({ status: "saved" });
  
} else {
  // Let them proceed to standard billing cancellation
  proceedToStripeBillingPortal();
  await session.complete({ status: "churned" });
}
Every decision made during the Web SDK session is stateful and is fed directly into your global deflection rate metrics and saved MRR counters on the dashboard.

Next steps