npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sdods/marketing

v1.0.0

Published

Universal marketing automation abstraction layer - vendor-agnostic contracts for SEO, email, ads, and social media

Readme

@sdods/marketing

Universal marketing automation abstraction layer — vendor-agnostic contracts for SEO, email, ads, and social media.

Features

  • 🔄 Vendor Agnostic — Switch between providers without code changes
  • 📊 SEO Tools — Backlinks, keywords, domain analysis, site audits
  • 📧 Email Marketing — Campaigns, contacts, lists, automation
  • 📢 Ad Platforms — Meta, Google, TikTok, LinkedIn campaigns
  • 📱 Social Media — Multi-platform publishing and analytics
  • 🔗 Unified API — Single interface for all marketing operations

Installation

npm install @sdods/marketing

Quick Start

import { createMarketingService } from '@sdods/marketing';
import { createAhrefsProvider } from '@sdods/marketing/seo';
import { createMailchimpProvider } from '@sdods/marketing/email';
import { createMetaAdsProvider } from '@sdods/marketing/ads';
import { createBufferProvider } from '@sdods/marketing/social';

// Initialize providers
const marketing = createMarketingService({
  seoProviders: {
    ahrefs: createAhrefsProvider({ apiKey: process.env.AHREFS_API_KEY }),
  },
  emailProviders: {
    mailchimp: createMailchimpProvider({ apiKey: process.env.MAILCHIMP_API_KEY }),
  },
  adsProviders: {
    meta: createMetaAdsProvider({ accessToken: process.env.META_ACCESS_TOKEN }),
  },
  socialProviders: {
    buffer: createBufferProvider({ accessToken: process.env.BUFFER_ACCESS_TOKEN }),
  },
  defaultSEO: 'ahrefs',
  defaultEmail: 'mailchimp',
});

Provider Contracts

SEO Provider

interface SEOProvider {
  // Backlinks
  getBacklinks(input: GetBacklinksInput): Promise<MarketingResult<PaginatedResult<Backlink>>>;
  getNewBacklinks(domain: string, days?: number): Promise<MarketingResult<Backlink[]>>;
  getLostBacklinks(domain: string, days?: number): Promise<MarketingResult<Backlink[]>>;
  
  // Keywords
  trackKeywords(input: TrackKeywordsInput): Promise<MarketingResult<KeywordRanking[]>>;
  getKeywordSuggestions(seed: string): Promise<MarketingResult<KeywordSuggestion[]>>;
  
  // Domain Analysis
  getDomainMetrics(domain: string): Promise<MarketingResult<DomainMetrics>>;
  
  // Site Audit
  runSiteAudit(domain: string): Promise<MarketingResult<{ auditId: string }>>;
  getSiteAuditResults(auditId: string): Promise<MarketingResult<SiteAuditIssue[]>>;
}

Supported Providers: Ahrefs, SEMrush, Moz, Majestic, Ubersuggest

Email Provider

interface EmailProvider {
  // Contacts
  createContact(input: CreateContactInput): Promise<MarketingResult<EmailContact>>;
  listContacts(listId?: string): Promise<MarketingResult<PaginatedResult<EmailContact>>>;
  
  // Lists
  createList(name: string): Promise<MarketingResult<EmailList>>;
  getLists(): Promise<MarketingResult<EmailList[]>>;
  
  // Campaigns
  createCampaign(input: CreateCampaignInput): Promise<MarketingResult<EmailCampaign>>;
  sendCampaign(campaignId: string): Promise<MarketingResult<void>>;
  getCampaignMetrics(campaignId: string): Promise<MarketingResult<EmailMetrics>>;
  
  // Transactional
  sendTransactionalEmail(to: string, templateId: string, data: Record<string, unknown>): Promise<MarketingResult<{ messageId: string }>>;
}

Supported Providers: Mailchimp, SendGrid, ConvertKit, Klaviyo, ActiveCampaign

Ads Provider

interface AdsProvider {
  // Campaigns
  createCampaign(input: CreateAdCampaignInput): Promise<MarketingResult<AdCampaign>>;
  getCampaignMetrics(campaignId: string, dateRange: DateRange): Promise<MarketingResult<AdMetrics>>;
  
  // Ad Sets & Creatives
  createAdSet(campaignId: string, input: AdSetInput): Promise<MarketingResult<AdSet>>;
  createCreative(adSetId: string, input: CreativeInput): Promise<MarketingResult<AdCreative>>;
  
  // Audiences
  createCustomAudience(accountId: string, name: string, emails: string[]): Promise<MarketingResult<{ audienceId: string }>>;
  createLookalikeAudience(sourceAudienceId: string, name: string, size: number): Promise<MarketingResult<{ audienceId: string }>>;
}

Supported Platforms: Meta Ads, Google Ads, TikTok Ads, LinkedIn Ads

Social Provider

interface SocialProvider {
  // Accounts
  getConnectedAccounts(): Promise<MarketingResult<SocialAccount[]>>;
  
  // Posts
  createPost(input: CreatePostInput): Promise<MarketingResult<SocialPost>>;
  schedulePost(postId: string, scheduledAt: Date): Promise<MarketingResult<void>>;
  publishNow(postId: string): Promise<MarketingResult<void>>;
  
  // Metrics
  getPostMetrics(postId: string): Promise<MarketingResult<SocialMetrics>>;
  getAudienceInsights(accountId: string): Promise<MarketingResult<AudienceInsights>>;
  getBestPostingTimes(accountId: string): Promise<MarketingResult<PostingTime[]>>;
}

Supported Providers: Buffer, Hootsuite, Sprout Social, Later, native APIs

Usage Examples

SEO: Track Backlinks

const seo = marketing.getSEOProvider();

// Get all backlinks
const { data: backlinks } = await seo.getBacklinks({
  domain: 'yarlis.com',
  limit: 100,
  orderBy: 'domain_rating',
});

// Track new backlinks
const { data: newLinks } = await seo.getNewBacklinks('yarlis.com', 7);

// Get domain metrics
const { data: metrics } = await seo.getDomainMetrics('competitor.com');
console.log(`DR: ${metrics.domainRating}, Traffic: ${metrics.organicTraffic}`);

Email: Run a Campaign

const email = marketing.getEmailProvider();

// Create campaign
const { data: campaign } = await email.createCampaign({
  name: 'Product Launch',
  subject: '🚀 Introducing Yarlis AI',
  fromName: 'Siri',
  fromEmail: '[email protected]',
  htmlContent: '<h1>Welcome!</h1>...',
  listIds: ['list_123'],
});

// Send it
await email.sendCampaign(campaign.id);

// Check metrics
const { data: metrics } = await email.getCampaignMetrics(campaign.id);
console.log(`Open rate: ${metrics.openRate}%`);

Ads: Launch a Campaign

const ads = marketing.getAdsProvider();

// Create campaign
const { data: campaign } = await ads.createCampaign({
  accountId: 'act_123',
  name: 'Yarlis Launch',
  objective: 'leads',
  budget: { type: 'daily', amount: 50 },
});

// Add targeting
const { data: adSet } = await ads.createAdSet(campaign.id, {
  name: 'Tech Founders',
  targeting: {
    interests: ['startups', 'saas', 'ai'],
    ageMin: 25,
    ageMax: 54,
  },
});

// Get metrics
const { data: metrics } = await ads.getCampaignMetrics(campaign.id, {
  start: new Date('2026-01-01'),
  end: new Date(),
});
console.log(`ROAS: ${metrics.roas}x`);

Social: Cross-Platform Publishing

const social = marketing.getSocialProvider();

// Publish to all platforms at once
const { data: posts } = await marketing.publishToAllPlatforms(
  '🚀 Just launched Yarlis Research Copilot! Try it free at yarlis.com',
  ['https://yarlis.com/og-image.png']
);

// Schedule a post
const { data: post } = await social.createPost({
  accountId: 'twitter_123',
  content: 'Building in public! Day 1 of the 22-day portfolio challenge.',
  scheduledAt: new Date('2026-02-15T09:00:00'),
});

// Get best posting times
const { data: times } = await social.getBestPostingTimes('instagram_456');

Implementing Custom Providers

import type { SEOProvider } from '@sdods/marketing';

export function createCustomSEOProvider(config: { apiKey: string }): SEOProvider {
  return {
    name: 'custom-seo',
    isConfigured: !!config.apiKey,

    async getBacklinks(input) {
      // Your implementation
      const response = await fetch(`https://api.custom-seo.com/backlinks?domain=${input.domain}`);
      const data = await response.json();
      return { success: true, data };
    },

    // ... implement other methods
  };
}

License

MIT © Yarlis