The official TypeScript SDK for AdsForge. Build powerful Meta advertising integrations with type-safe functions and real-time campaign management.
npm install @adsforge/sdkimport { getMetaPages }Full type safety includedInstall and start using the SDK
Create and manage campaigns using AI or manual configuration
Get available targeting countries
Access your Facebook Pages
Manage your Meta ad accounts
Get available targeting languages
Manage conversion tracking pixels
Estimate potential audience reach
Search targeting interests
TypeScript interfaces for SDK 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
}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
}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
}