fontFamilydsForgeJoin the waitlist
SDK Documentation

AdsForge SDK

The official TypeScript SDK for AdsForge. Build powerful Meta advertising integrations with type-safe functions and real-time campaign management.

Install

npm install @adsforge/sdk

Import

import { getMetaPages }

TypeScript

Full type safety included

Getting Started

Install and start using the SDK

Campaign Management

Create and manage campaigns using AI or manual configuration

Meta Countries

Get available targeting countries

Meta Pages

Access your Facebook Pages

Meta Ad Accounts

Manage your Meta ad accounts

Meta Languages

Get available targeting languages

Meta Pixels

Manage conversion tracking pixels

Reach Estimation

Estimate potential audience reach

Meta Interests

Search targeting interests

Type Definitions

TypeScript interfaces for SDK types

Campaign Types

interface Campaign {
  _id: string
  name: string
  status: 'PAUSED' | 'ACTIVE' | 'DRAFT' | 'COMPLETED'
  objective: 'OUTCOME_ENGAGEMENT' | 'OUTCOME_TRAFFIC' | 'OUTCOME_CONVERSIONS'
  budget: {
    value: number
    budgetType: 'DAILY' | 'LIFETIME'
  }
  countries: string[]
  genders: 'ALL' | 'MALE' | 'FEMALE'
  ageMin: number
  ageMax: number
  interests: Array<{
    name: string
    _id: string
  }>
  // Ad content
  headline: string
  primaryText: string
  description: string
  callToAction: string
  startTime: string
  endTime: string
  createdAt: string
  updatedAt: string
}

Meta Resource Types

interface Page {
  id: string
  name: string
  category: string
  accessToken: string
  business: {
    id: string
    name: string
  }
}

interface AdAccount {
  id: string
  name: string
  status: string
  currency: string
  amount_spent: string
}

interface Country {
  key: string
  name: string
  country_code: string
  supports_region: boolean
  supports_city: boolean
}

interface Language {
  key: number
  name: string
}

interface Interest {
  id: string
  name: string
  audience_size_lower_bound: number
  audience_size_upper_bound: number
  path: string[]
  topic: string
}

interface Pixel {
  id: string
  name: string
  code: string
}

Response Types

interface CountryResponse {
  allCountries: Country[]
  englishSpeakingCountries: Country[]
  spanishSpeakingCountries: Country[]
}

interface ReachEstimate {
  users_lower_bound: number
  users_upper_bound: number
  estimate_ready: boolean
}

interface PublishResult {
  success: boolean
  campaignId: string
}