Skip to content

Repository files navigation

Leadpipe SDKs

Public SDKs for Leadpipe. This repository starts with one unified TypeScript client and is structured so other SDK languages can be added later without a rewrite.

What This Is

Leadpipe exposes intent data APIs for topic discovery, audience building, materialized audience results, runs, stats, and exports. The current public package is @leadpipe/client and it ships a single Leadpipe class for both anonymous discovery and authenticated audience workflows.

Repo Structure

packages/
typescript/ # @leadpipe/client
examples/ # runnable usage samples
spec/ # checked-in OpenAPI snapshot for the intent API

Install

npm install @leadpipe/client

or

pnpm add @leadpipe/client

Auth

The same client supports both modes, but they are not interchangeable:

import{Leadpipe}from"@leadpipe/client";constpublicClient=newLeadpipe();constapiKeyClient=newLeadpipe({apiKey: process.env.LEADPIPE_API_KEY});constbearerClient=newLeadpipe({bearerToken: process.env.LEADPIPE_BEARER_TOKEN});

Use new Leadpipe() only for public discovery routes:

  • client.intent.topics.list()
  • client.intent.topics.facets()
  • client.intent.topics.search()
  • client.intent.topics.trend()
  • client.intent.topics.compare()
  • client.intent.topics.movers()
  • client.intent.topics.analyze()

Use apiKey or bearerToken for anything audience-related:

  • client.intent.audiences.preview()
  • client.intent.audiences.query()
  • client.intent.audiences.create()
  • client.intent.audiences.update()
  • client.intent.audiences.status()
  • client.intent.audiences.results()
  • client.intent.audiences.runs()
  • client.intent.audiences.stats()
  • client.intent.audiences.export()
  • client.intent.audiences.waitUntilReady()

Most developers should use an API key. Anonymous usage is mainly for topic discovery and site analysis.

Quickstart

import{Leadpipe}from"@leadpipe/client";constclient=newLeadpipe({apiKey: process.env.LEADPIPE_API_KEY});consttopics=awaitclient.intent.topics.list({type: "b2b",q: "data platform"});console.log(topics.data.slice(0,3));

Topic Discovery

constfacets=awaitclient.intent.topics.facets();constsearch=awaitclient.intent.topics.search({q: "data platform",limit: 10});consttrend=awaitclient.intent.topics.trend(1234);constcompare=awaitclient.intent.topics.compare([1234,5678]);constmovers=awaitclient.intent.topics.movers({direction: "up",limit: 10});constanalysis=awaitclient.intent.topics.analyze({url: "https://snowflake.com"});

Audience Preview

consttopicSearch=awaitclient.intent.topics.search({q: "crm",limit: 2});consttopicIds=topicSearch.data.slice(0,2).map((topic)=>topic.topicId);constpreview=awaitclient.intent.audiences.preview({
topicIds,minScore: 70,filters: {companyIndustry: ["software development"],hasBusinessEmail: true,},});

Create And Activate

consttopicSearch=awaitclient.intent.topics.search({q: "crm",limit: 2});consttopicIds=topicSearch.data.slice(0,2).map((topic)=>topic.topicId);constcreated=awaitclient.intent.audiences.create({name: "Sales-led SaaS buyers",config: {
topicIds,minScore: 70,filters: {companyIndustry: ["software development"],},},});constupdated=awaitclient.intent.audiences.update(created.data.id,{status: "active",});

Poll Status

constready=awaitclient.intent.audiences.waitUntilReady(updated.data.id,{timeoutMs: 600_000,intervalMs: 5_000,});

Fetch Results

conststatus=awaitclient.intent.audiences.status(updated.data.id);constresults=awaitclient.intent.audiences.results(updated.data.id,{limit: 25,});

Export

constexportJob=awaitclient.intent.audiences.export(updated.data.id);console.log(exportJob.data.downloadUrl);

Notes

  • The repo currently ships one official public SDK: @leadpipe/client
  • client.intent.topics.* covers public discovery routes
  • client.intent.audiences.* covers authenticated audience building and results
  • identification / resolution modules are not part of the current SDK yet

About

Official SDKs for Leadpipe APIs. Start with TypeScript for public topic discovery and authenticated audience workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages