New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

bulktemplates

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bulktemplates

Social media image generation API for AI agents, LLMs, and developers. Browse 80+ templates, render PNGs, and run batch jobs programmatically.

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

bulktemplates

The official BulkTemplates SDK for Node.js — programmatic image generation API and MCP server in one package. Browse 80+ social media templates, render PNGs, and run batch jobs from your code or AI agent.

Use it as a JavaScript SDK — import it in your code and call the API directly:

import { BulkTemplates } from 'bulktemplates';
const bt = new BulkTemplates({ apiKey: 'bk_...' });
const png = await bt.images.image('quote-card', { quote: 'Ship it.' });

Or use it as an MCP server — connect it to Claude Desktop or Cursor so your AI agent can generate images without writing any code:

npx bulktemplates

Requirements

  • Node.js ≥ 18
  • A BulkTemplates API key — get one at bulktemplates.com/api

Installation

npm install bulktemplates

Programmatic SDK

import { BulkTemplates } from 'bulktemplates';

const bt = new BulkTemplates({ apiKey: 'bk_...' });

Templates

// Browse all templates (lightweight)
const list = await bt.templates.list({ summary: true });

// Filter by IDs
const picked = await bt.templates.list({ ids: 'quote-card,tweet-style' });

// Full template definition — shows field names needed for rendering
const tpl = await bt.templates.get('quote-card');

Render an image

// Returns a Buffer containing the PNG
const png = await bt.images.image('quote-card', {
  quote: 'Ship it.',
  author: 'Ada Lovelace',
});

// Save to disk
import { writeFileSync } from 'fs';
writeFileSync('out.png', png);

// Override font
const png2 = await bt.images.image('quote-card', data, {
  fontFamily: 'playfair-display',
});

Batch jobs

// Start a batch (max 1,000 rows)
const job = await bt.batch.create('announcement', [
  { headline: 'Product launch', date: 'May 1' },
  { headline: 'Webinar',        date: 'May 8' },
]);

// Poll until done
let status = await bt.batch.poll(job.id);
while (status.status !== 'done') {
  await new Promise(r => setTimeout(r, 2000));
  status = await bt.batch.poll(job.id);
}
console.log(status.files); // paths to rendered PNGs

Fonts

const fonts = await bt.fonts.list();
// [{ id: 'inter', name: 'Inter' }, { id: 'playfair-display', name: 'Playfair Display' }, ...]

Error handling

import { BulkTemplates, AuthenticationError, NotFoundError, RateLimitError } from 'bulktemplates';

try {
  const png = await bt.images.image('quote-card', data);
} catch (err) {
  if (err instanceof AuthenticationError) console.error('Bad API key');
  if (err instanceof NotFoundError)       console.error('Template not found');
  if (err instanceof RateLimitError)      console.error('Slow down');
}

MCP Server

Use with Claude Desktop, Cursor, or any MCP-compatible client. The server exposes 6 tools: list_templates, get_template, render_image, list_fonts, create_batch_job, poll_batch_job.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "bulktemplates": {
      "command": "npx",
      "args": ["-y", "bulktemplates"],
      "env": {
        "BULKTEMPLATES_API_KEY": "bk_YOUR_KEY_HERE"
      }
    }
  }
}

Cursor / VS Code

{
  "mcpServers": {
    "bulktemplates": {
      "command": "npx",
      "args": ["-y", "bulktemplates"],
      "env": {
        "BULKTEMPLATES_API_KEY": "bk_YOUR_KEY_HERE"
      }
    }
  }
}

Run directly

BULKTEMPLATES_API_KEY=bk_... npx bulktemplates

API reference

BulkTemplates(config)

OptionTypeRequiredDefault
apiKeystringYes—
baseUrlstringNohttps://bulktemplates.com

Resources

ResourceMethodDescription
bt.templateslist(opts?)List templates. opts.summary for lightweight, opts.ids to filter
bt.templatesget(id)Full template definition with field names
bt.imagesimage(templateId, data, opts?)Render PNG → Buffer. opts.fontFamily to override font
bt.batchcreate(templateId, rows)Start async batch job (max 1,000 rows)
bt.batchpoll(id)Check job status; files array available when status === 'done'
bt.fontslist()All available font IDs

Error classes

ClassHTTP statusWhen thrown
BulkTemplatesErroranyBase class
AuthenticationError401Invalid or missing API key
NotFoundError404Template or job not found
RateLimitError429Too many requests
ValidationError422Bad request payload

Environment variables (MCP server)

VariableRequiredDefaultDescription
BULKTEMPLATES_API_KEYYes—Your API key
BULKTEMPLATES_API_BASENohttps://bulktemplates.comOverride base URL

Template categories

80+ templates across social media, B2B, editorial, lifestyle, fitness, commerce, and events. Aspect ratios: 1:1 · 4:5 · 9:16 · 16:9 · 3:1

Example IDs: quote-card, tweet-style, event-card, testimonial, product-launch, podcast-episode, linkedin-banner, youtube-thumb, breaking-news-red, magazine-cover and many more.

License

MIT

Keywords

bulktemplates

FAQs

Package last updated on 24 Apr 2026

Related posts