Skip to main content
Complete TypeScript type definitions for all SDK interfaces.

Core Types

Company

interface Company {
  id: string;
  name: string;
}

CompanyWithDetails

interface CompanyWithDetails {
  name: string;
  website?: string;
  domain?: string;
  industry?: string;
  employee_count?: number;
  revenue?: number;
  linkedin_url?: string;
  founded_year?: number;
  location?: string;
  description?: string;
}

Place

interface Place {
  name: string;
  address: string;
  phone?: string;
  website?: string;
  rating?: number;
  reviewCount?: number;
  placeId: string;
  types?: string[];
  hours?: {
    monday?: string;
    tuesday?: string;
    wednesday?: string;
    thursday?: string;
    friday?: string;
    saturday?: string;
    sunday?: string;
  };
  priceLevel?: number;
}

Person

interface Person {
  name: string;
  title: string;
  company: string;
  domain?: string;
  email?: string;
  linkedin_url?: string;
  phone?: string;
}

ValidationResult

interface ValidationResult {
  value: string;
  valid: boolean;
  status: string;
  reason?: string;
}

Provider Types

CompanyDiscoveryProvider

type CompanyDiscoveryProvider =
  | "apollo"
  | "exa"
  | "linkedin";

PeopleSearchProvider

type PeopleSearchProvider =
  | "apollo"
  | "sonar_pro"
  | "sonar_deep_research"
  | "gpt-5"
  | "gpt_4o"
  | "gemini"
  | "o4_mini_deep_research"
  | "pdl";

ContactEnrichmentProvider

type ContactEnrichmentProvider =
  | "apollo"
  | "leadmagic"
  | "findymail"
  | "prospeo"
  | "datagma"
  | "crustdata"
  | "exa"
  | "pdl"
  | "lusha"
  | "sonar_pro"
  | "sonar_deep_research"
  | "gemini"
  | "openai_deep_research"
  | "openai_gpt4o";

ResearchModel

type ResearchModel =
  | "gpt-5-nano"
  | "o4-mini-deep-research"
  | "sonar-deep-research"
  | "sonar-pro"
  | "sonar-mini"
  | "gemini-2.5-pro";

Parameter Types

CompanyFindParams

interface CompanyFindParams {
  // What kind of companies?
  industries?: string[];
  keywords?: string[];
  technologies?: string[];

  // Where?
  countries?: string[];
  states?: string[];
  cities?: string[];
  location?: string;

  // How big?
  employeeCountMin?: number;
  employeeCountMax?: number;
  revenueMin?: number;
  revenueMax?: number;

  // How many?
  limit?: number;

  // Advanced: Override provider selection
  _provider?: CompanyDiscoveryProvider;
}

PlaceFindParams

interface PlaceFindParams {
  // What are you looking for?
  query: string;
  keywords?: string[];

  // Where?
  location?: string;
  coordinates?: { lat: number; lng: number };
  radius?: number; // meters, default 5000

  // Filters
  minRating?: number;
  minReviews?: number;
  hasWebsite?: boolean;
  openNow?: boolean;

  // How many?
  limit?: number;
}

PeopleSearchParams

interface PeopleSearchParams {
  companies: CompanyWithDetails[];
  titles?: string[];
  seniorities?: string[];
  departments?: string[];
  maxPerCompany?: number;
  _providers?: PeopleSearchProvider[];
}

ContactEnrichParams

interface ContactEnrichParams {
  people: Person[];
  _emailProviders?: ContactEnrichmentProvider[];
  _phoneProviders?: ContactEnrichmentProvider[];
}

EmailValidateParams

interface EmailValidateParams {
  emails: string[];
}

PhoneValidateParams

interface PhoneValidateParams {
  phones: string[];
}

AIResearchParams

interface AIResearchParams {
  prompt: string;
  data: Record<string, unknown>;
  model?: ResearchModel;
  maxTokens?: number;
}

Module Interfaces

CanvasSDK

The main SDK interface:
interface CanvasSDK {
  // Core modules
  companies: CompaniesModule;
  places: PlacesModule;
  people: PeopleModule;
  contacts: ContactsModule;
  ai: AIModule;
  
  // Social modules
  linkedin: LinkedInModule;
  instagram: InstagramModule;
  
  // Utilities
  log: (...args: unknown[]) => void;
  delay: (ms: number) => Promise<void>;
}

CompaniesModule

interface CompaniesModule {
  find: (params: CompanyFindParams) => Promise<CompanyWithDetails[]>;
}

PlacesModule

interface PlacesModule {
  find: (params: PlaceFindParams) => Promise<Place[]>;
}

PeopleModule

interface PeopleModule {
  search: (params: PeopleSearchParams) => Promise<Person[]>;
}

ContactsModule

interface ContactsModule {
  enrich: (params: ContactEnrichParams) => Promise<Person[]>;
  email: ContactsEmailModule;
  phone: ContactsPhoneModule;
}

interface ContactsEmailModule {
  validate: (params: EmailValidateParams) => Promise<ValidationResult[]>;
}

interface ContactsPhoneModule {
  validate: (params: PhoneValidateParams) => Promise<ValidationResult[]>;
}

AIModule

interface AIModule {
  research: (params: AIResearchParams) => Promise<string>;
}

LinkedInModule

interface LinkedInModule {
  profiles: (params: LinkedInProfilesParams) => Promise<LinkedInProfile[]>;
  posts: (params: LinkedInPostsParams) => Promise<LinkedInPost[]>;
  findUrls: (params: LinkedInFindUrlsParams) => Promise<PersonWithUrl[]>;
  reactions: (params: LinkedInReactionsParams) => Promise<Reactor[]>;
}

InstagramModule

interface InstagramModule {
  profiles: (params: InstagramProfilesParams) => Promise<InstagramProfile[]>;
}

LinkedIn Types

LinkedInProfilesParams

interface LinkedInProfilesParams {
  urls: string[];
  fields?: LinkedInProfileField[];
}

LinkedInPostsParams

interface LinkedInPostsParams {
  urls: string[];
  postsPerProfile?: number;
  includeReposts?: boolean;
  includeComments?: boolean;
  fields?: LinkedInPostField[];
}

LinkedInFindUrlsParams

interface LinkedInFindUrlsParams {
  people: Array<{
    firstName?: string;
    lastName?: string;
    fullName?: string;
    company: string;
  }>;
}

LinkedInReactionsParams

interface LinkedInReactionsParams {
  postUrls: string[];
  maxPerPost?: number;
}

LinkedInProfile

interface LinkedInProfile {
  linkedinUrl: string;
  firstName?: string;
  lastName?: string;
  fullName?: string;
  headline?: string;
  about?: string;
  connections?: number;
  followers?: number;
  email?: string;
  profilePic?: string;
  jobTitle?: string;
  companyName?: string;
  companyIndustry?: string;
  companyWebsite?: string;
  companySize?: string;
  jobDuration?: string;
  jobDurationYears?: number;
  country?: string;
  addressFull?: string;
  addressLocal?: string;
  mobileNumber?: string;
  topSkills?: string[];
  totalSkills?: number;
  recentExperience?: object;
  totalExperience?: number;
  education?: object[];
}

LinkedInPost

interface LinkedInPost {
  postText: string;
  postLink: string;
  postedAgo: string;
  actorName: string;
  actorDescription: string;
  numLikes: number;
  numComments: number;
  numShares: number;
  imageComponent?: string[];
  videoComponent?: object;
  linksInPost?: string[];
  urn: string;
  isRepost: boolean;
  comments?: object[];
}

LinkedInProfileField

type LinkedInProfileField =
  | "firstName" | "lastName" | "fullName" | "headline" | "about"
  | "connections" | "followers" | "email" | "profilePic"
  | "jobTitle" | "companyName" | "companyIndustry" | "companyWebsite"
  | "companySize" | "jobDuration" | "jobDurationYears"
  | "country" | "addressFull" | "addressLocal" | "mobileNumber"
  | "topSkills" | "totalSkills" | "recentExperience" | "totalExperience" | "education";

LinkedInPostField

type LinkedInPostField =
  | "postText" | "postLink" | "postedAgo" | "actorName" | "actorDescription"
  | "numLikes" | "numComments" | "numShares" | "imageComponent"
  | "videoComponent" | "linksInPost" | "urn" | "isRepost" | "comments";

Instagram Types

InstagramProfilesParams

interface InstagramProfilesParams {
  handles: string[];
  postsLimit?: number;
  fields?: InstagramField[];
}

InstagramProfile

interface InstagramProfile {
  handle: string;
  followers?: number;
  following?: number;
  postsCount?: number;
  fullName?: string;
  bio?: string;
  verified?: boolean;
  business?: boolean;
  externalUrl?: string;
  profileUrl?: string;
  recentPostCaption?: string;
  recentPostLikes?: number;
  recentPostComments?: number;
  recentPostDate?: string;
  recentPostType?: string;
  recentPostUrl?: string;
  avgLikes?: number;
  avgComments?: number;
  engagementRate?: number;
  totalScrapedPosts?: number;
}

InstagramField

type InstagramField =
  | "followers" | "following" | "postsCount" | "fullName" | "bio"
  | "verified" | "business" | "externalUrl" | "profileUrl"
  | "recentPostCaption" | "recentPostLikes" | "recentPostComments"
  | "recentPostDate" | "recentPostType" | "recentPostUrl"
  | "avgLikes" | "avgComments" | "engagementRate" | "totalScrapedPosts";