Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vibefollow.com/llms.txt

Use this file to discover all available pages before exploring further.

The SDK exports a curated set of public types. Internals (HTTP client, retry config, etc.) are intentionally not exported — they’re refactoring surface area, not contract.

VibeFollowOptions

The constructor options object.
interface VibeFollowOptions {
  /** API key — sk_live_… or sk_test_… */
  apiKey: string;
  /** Base URL. Defaults to 'https://api.vibefollow.com'. */
  baseUrl?: string;
  /** Per-request timeout in ms. Defaults to 10000 (10s). */
  timeoutMs?: number;
  /** Max retries on 429/5xx/network. Defaults to 2. */
  maxRetries?: number;
  /** Injectable fetch (testing, edge runtimes). Defaults to globalThis.fetch. */
  fetchImpl?: typeof fetch;
}
See VibeFollow class for the per-field details.

IdentifyTraits

The traits bag passed to vf.users.identify(). Known fields are typed; everything else is permitted under the index signature.
interface IdentifyTraits {
  email?: string;
  name?: string;
  plan?: string;
  signupDate?: string;
  company?: string;
  role?: string;
  [k: string]: unknown;
}

EventProperties

The properties bag passed to vf.events.track() and lifecycle helpers.
type EventProperties = Record<string, unknown>;

STANDARD_EVENT_NAMES and StandardEventName

The canonical 9 lifecycle event names. The same list used by the typed helpers on vf.users.
const STANDARD_EVENT_NAMES = [
  'user_signed_up',
  'trial_started',
  'feature_used',
  'onboarding_step',
  'subscription_changed',
  'subscription_cancelled',
  'payment_failed',
  'trial_expiring',
  'user_invited',
] as const;

type StandardEventName = (typeof STANDARD_EVENT_NAMES)[number];
Useful for runtime validation:
import { STANDARD_EVENT_NAMES } from '@vibefollow/sdk';
import type { StandardEventName } from '@vibefollow/sdk';

function isStandard(name: string): name is StandardEventName {
  return (STANDARD_EVENT_NAMES as readonly string[]).includes(name);
}

WebhookEvent union

The return type of vf.webhooks.constructEvent(). A discriminated union over type.
type WebhookEvent =
  | EmailOpenedEvent
  | EmailClickedEvent
  | EmailBouncedEvent
  | EmailRepliedEvent
  | EmailUnsubscribedEvent;
See the per-type payload spec in Webhook event types. Every member shares the envelope:
{
  type: 'email.opened' | 'email.clicked' | …;
  id: string;       // unique per delivery
  created: number;  // Unix seconds
  data: { … };      // type-specific
}

Per-event types

interface EmailOpenedEvent {
  type: 'email.opened';
  id: string;
  created: number;
  data: {
    draftId: string;
    projectId: string;
    externalUserId: string;
    messageId: string;
    openedAt: string;
  };
}
interface EmailClickedEvent {
  type: 'email.clicked';
  id: string;
  created: number;
  data: {
    draftId: string;
    projectId: string;
    externalUserId: string;
    messageId: string;
    url: string;
    clickedAt: string;
  };
}
interface EmailBouncedEvent {
  type: 'email.bounced';
  id: string;
  created: number;
  data: {
    draftId: string;
    projectId: string;
    externalUserId: string;
    messageId: string;
    bounceType: 'hard' | 'soft' | 'transient' | 'complaint' | 'unknown';
    reason?: string;
    bouncedAt: string;
  };
}
interface EmailRepliedEvent {
  type: 'email.replied';
  id: string;
  created: number;
  data: {
    draftId: string;
    projectId: string;
    externalUserId: string;
    messageId: string;
    replyBody: string;
    tone: 'positive' | 'neutral' | 'negative' | 'unsubscribe_request';
    receivedAt: string;
  };
}
interface EmailUnsubscribedEvent {
  type: 'email.unsubscribed';
  id: string;
  created: number;
  data: {
    projectId: string;
    externalUserId: string;
    email: string;
    source: 'one_click' | 'reply_request' | 'manual';
    unsubscribedAt: string;
  };
}

SDK_VERSION

The current SDK version as a string. Flows into the User-Agent header on every request.
import { SDK_VERSION } from '@vibefollow/sdk';
console.log(SDK_VERSION); // e.g. "1.0.0"