Integration Guides

Integrate TrackPost into your application using the method that works best for your tech stack and workflow.

Table of Contents

Integration Options

TrackPost offers multiple ways to integrate:

Command Line Interface (CLI)

Best for:

  • Testing and debugging
  • Scripting and automation
  • Quick operations without writing code
  • CI/CD pipelines

CLI Guide →

Software Development Kits (SDKs)

Best for:

  • Native language integration
  • Type safety and autocomplete
  • Simplified error handling
  • Best developer experience

Available SDKs:

  • Node.js SDK - TypeScript/JavaScript support
  • Python SDK - Coming soon
  • Go SDK - Coming soon

REST API

Best for:

  • Any programming language
  • Custom integrations
  • Low-level control
  • Microservices architecture

API Reference →

Quick Comparison

FeatureCLINode.js SDKREST API
Setup Time1 minute2 minutes5 minutes
Type Safety-Manual
Error HandlingAutomaticAutomaticManual
Best ForScripts, testingProduction appsCustom integrations
Language SupportNode.js (global)Node.jsAny HTTP-capable language

Choose Your Path

  • CLI
  • Node.js
  • REST API

For developers who prefer command-line workflows.

# Install globally
npm install -g @trackpost/cli

# Send an email
trackpost send --to [email protected] \
  --from [email protected] \
  --subject "Welcome!" \
  --html "<h1>Welcome to our app!</h1>"

Full CLI Guide →

For Node.js and TypeScript applications.

npm install trackpost
import { TrackPostClient } from 'trackpost';

const client = new TrackPostClient({ apiKey: 'tp_live_...' });

await client.emails.send({
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Welcome to our app!</h1>'
});

Node.js SDK Guide →

For any programming language or custom integrations.

curl -X POST https://api.trackpost.de/v1/emails \
  -H "Authorization: Bearer tp_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "from": "[email protected]",
    "subject": "Welcome!",
    "html": "<h1>Welcome to our app!</h1>"
  }'

API Reference →

Common Integration Patterns

1. Welcome Email on User Registration

// Node.js SDK example
app.post('/register', async (req, res) => {
  const user = await createUser(req.body);
  
  await trackpost.emails.send({
    to: user.email,
    from: '[email protected]',
    template_id: 'welcome_email',
    variables: {
      user_name: user.name,
      activation_link: generateActivationLink(user)
    }
  });
  
  res.json({ success: true });
});

2. Password Reset Flow

// Using template with variables
await trackpost.emails.send({
  to: user.email,
  from: '[email protected]',
  template_id: 'password_reset',
  variables: {
    reset_link: `https://yourapp.com/reset?token=${token}`,
    expiry_time: '1 hour'
  }
});

3. Batch Email Sending

// Send to multiple recipients
const users = await getRecentSignups();

await Promise.all(users.map(user => 
  trackpost.emails.send({
    to: user.email,
    from: '[email protected]',
    template_id: 'weekly_digest',
    variables: {
      user_name: user.name,
      last_login: user.lastLogin
    }
  })
));

4. Webhook Event Handling

// Express webhook handler
app.post('/webhooks/trackpost', async (req, res) => {
  const event = req.body;
  
  if (event.type === 'email.bounced') {
    await markEmailAsInvalid(event.data.to);
  }
  
  if (event.type === 'email.opened') {
    await incrementOpenCount(event.data.email_id);
  }
  
  res.status(200).send('OK');
});

SDK Roadmap

We’re actively developing SDKs for more languages:

LanguageStatusETA
Node.js✅ AvailableNow
Python🚧 In ProgressQ1 2026
Go📋 PlannedQ2 2026
Ruby📋 PlannedQ2 2026
PHP📋 PlannedQ3 2026
Java📋 PlannedQ3 2026

Want to contribute? Check our GitHub repository for SDK development guidelines.

Next Steps

  1. CLI Guide - Master the command-line interface
  2. Node.js SDK - Build with TypeScript/JavaScript
  3. API Reference - Full REST API documentation
  4. Templates - Create reusable email templates