@competlab/sdk
v1.0.1
Published
TypeScript SDK for the CompetLab competitive intelligence API
Maintainers
Readme
@competlab/sdk
Track what ChatGPT, Claude, and Gemini say about your brand — programmatically.
40% of B2B buyers ask AI before they Google. This SDK gives you typed access to everything CompetLab monitors: AI visibility, competitor pricing, content changes, positioning shifts, and tech stack signals. 3 lines to your first insight.
Install
npm install @competlab/sdkQuick Start
import CompetLab from '@competlab/sdk';
const cl = new CompetLab({ apiKey: process.env.COMPETLAB_API_KEY });
// See how 3 AI systems rank your brand vs competitors
const visibility = await cl.aiVisibility.dashboard('proj_abc');What is CompetLab?
Competitive intelligence for the AI era. One platform, 5 dimensions, monitored automatically:
| Dimension | What It Tracks | |-----------|---------------| | Tech & Trust | Tech stacks, security headers, trust signals | | Content | Sitemaps, content categories, publishing cadence | | Positioning | Homepage messaging, value props, CTAs | | Pricing | Plans, pricing models, feature comparisons | | AI Visibility | How ChatGPT, Claude, and Gemini rank your brand vs competitors |
AI Visibility is what makes CompetLab unique — no other CI platform tracks how LLMs recommend brands in real time.
Available Resources
cl.health // API health check
cl.projects // List and get projects
cl.competitors // Monitored competitors
cl.techTrust // Tech stack & trust signals
cl.content // Content analysis & changelog
cl.positioning // Homepage messaging analysis
cl.pricing // Pricing intelligence
cl.aiVisibility // AI visibility scores & trends
cl.analysis // AI-generated action plans
cl.alerts // Competitive change alerts
cl.schedules // Monitoring schedules11 resources. 25 methods. Zero dependencies. Uses native fetch — no axios, no bloat.
Examples
See what AI says about you
const { data } = await cl.aiVisibility.dashboard('proj_abc');
// data.item.summary =>
// {
// customer: { domain: "you.com", mentionRate: 100, aiScore: 82 },
// topCompetitor: { domain: "rival.com", mentionRate: 33 },
// mentionRateGap: 67,
// competitorRankings: [
// { name: "You", domain: "you.com", mentionRate: 100, aiScore: 82, isOwn: true },
// { name: "Rival", domain: "rival.com", mentionRate: 33, aiScore: 31, isOwn: false }
// ]
// }Track how your AI ranking changes over time
const trend = await cl.aiVisibility.trend('proj_abc', {
provider: 'openai'
});
// Weekly snapshots of your visibility score — spot drops before they cost you dealsGet a competitive action plan
const plan = await cl.analysis.actionPlan('proj_abc');
// AI-generated priorities across all 5 dimensions:
// "Your competitor added 3 trust badges you're missing — here's which ones matter"Catch competitor pricing changes
const alerts = await cl.alerts.list('proj_abc', {
dimension: 'pricing',
severity: 'critical'
});
// Know the moment a competitor changes pricing — not weeks later from a churned customerCompare competitor tech stacks
const tech = await cl.techTrust.dashboard('proj_abc');
// Security headers, frameworks, CDNs, analytics tools — across all monitored competitorsMCP Server
Prefer AI-native access? CompetLab also offers an MCP server with 24 tools — connect Claude Code, Cursor, or VS Code directly.
API Reference
Full interactive API documentation with "Try It" panel:
Requirements
- Node.js 20+
- CompetLab API key (start free trial — 14 days, no credit card)
Troubleshooting
| Issue | Fix |
|-------|-----|
| api_key_missing error | Ensure you're passing the key via apiKey option or COMPETLAB_API_KEY env var |
| api_key_invalid error | Keys must start with cl_live_ and be exactly 40 characters |
| fetch is not defined | Requires Node.js 20+ (uses native fetch) |
| TypeScript type errors after update | Run npm install @competlab/sdk@latest and restart your TS server |
Links
- REST API Reference
- MCP Server (AI-native access with 24 tools)
- GitHub — MCP Server
- Privacy Policy
- Start Free Trial
Support
- Bug reports: GitHub Issues
- Email: [email protected]
- Documentation: competlab.com/developers
License
MIT — see LICENSE
Built by the CompetLab team. Competitive intelligence for the AI era.
