skills/add-node-sdk/SKILL.md
Integrate the Temps Node.js SDK for server-side analytics, KV storage, blob storage, and platform management. Use when the user wants to: (1) Track server-side events, (2) Use Temps KV (key-value) storage, (3) Use Temps Blob storage for files, (4) Access Temps API from Node.js, (5) Server-side analytics integration, (6) Backend event tracking. Triggers: "temps node sdk", "server-side analytics", "temps kv", "temps blob", "backend integration", "node.js temps".
npx skillsauth add gotempsh/temps add-node-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Integrate Temps platform features in Node.js applications.
# Core SDK
npm install @temps-sdk/node
# Individual packages (optional)
npm install @temps-sdk/kv # Key-Value storage
npm install @temps-sdk/blob # Blob/file storage
import { Temps } from '@temps-sdk/node';
const temps = new Temps({
apiKey: process.env.TEMPS_API_KEY,
projectId: process.env.TEMPS_PROJECT_ID,
});
Track events from your backend:
import { Temps } from '@temps-sdk/node';
const temps = new Temps({
apiKey: process.env.TEMPS_API_KEY,
projectId: process.env.TEMPS_PROJECT_ID,
});
// Track an event
await temps.track('purchase_completed', {
userId: 'user_123',
orderId: 'order_456',
amount: 99.99,
currency: 'USD',
items: ['product_1', 'product_2'],
});
// Identify a user
await temps.identify('user_123', {
email: '[email protected]',
name: 'John Doe',
plan: 'premium',
createdAt: new Date().toISOString(),
});
import express from 'express';
import { Temps } from '@temps-sdk/node';
const app = express();
const temps = new Temps({ apiKey: process.env.TEMPS_API_KEY });
// Track all API requests
app.use((req, res, next) => {
const start = Date.now();
res.on('finish', () => {
temps.track('api_request', {
method: req.method,
path: req.path,
statusCode: res.statusCode,
duration: Date.now() - start,
userId: req.user?.id,
});
});
next();
});
Simple key-value storage with automatic JSON serialization:
import { KV } from '@temps-sdk/kv';
const kv = new KV({
apiKey: process.env.TEMPS_API_KEY,
namespace: 'my-app', // Optional namespace
});
// Store values
await kv.set('user:123', { name: 'John', email: '[email protected]' });
await kv.set('session:abc', { userId: '123' }, { ttl: 3600 }); // 1 hour TTL
// Retrieve values
const user = await kv.get('user:123');
// { name: 'John', email: '[email protected]' }
// Check existence
const exists = await kv.has('user:123');
// Delete
await kv.delete('user:123');
// List keys
const keys = await kv.list({ prefix: 'user:' });
// ['user:123', 'user:456', ...]
// Set with TTL (seconds)
await kv.set('key', value, { ttl: 3600 });
// Set with metadata
await kv.set('key', value, {
metadata: { version: 1, updatedBy: 'system' }
});
// Get with metadata
const { value, metadata } = await kv.getWithMetadata('key');
// List with pagination
const result = await kv.list({
prefix: 'user:',
limit: 100,
cursor: 'next-cursor',
});
Store and retrieve files:
import { Blob } from '@temps-sdk/blob';
const blob = new Blob({
apiKey: process.env.TEMPS_API_KEY,
});
// Upload file from buffer
const file = await blob.put('avatars/user-123.png', imageBuffer, {
contentType: 'image/png',
metadata: { userId: '123' },
});
// Upload from stream
import { createReadStream } from 'fs';
await blob.put('backups/data.json', createReadStream('./data.json'), {
contentType: 'application/json',
});
// Get file
const data = await blob.get('avatars/user-123.png');
// Get as stream (for large files)
const stream = await blob.getStream('backups/data.json');
// Get signed URL (for client-side access)
const url = await blob.getSignedUrl('avatars/user-123.png', {
expiresIn: 3600, // 1 hour
});
// Delete
await blob.delete('avatars/user-123.png');
// List files
const files = await blob.list({ prefix: 'avatars/' });
Generate presigned upload URLs:
// Server: Generate upload URL
const uploadUrl = await blob.createUploadUrl('uploads/file.pdf', {
contentType: 'application/pdf',
maxSize: 10 * 1024 * 1024, // 10MB
expiresIn: 300, // 5 minutes
});
// Client: Upload directly to storage
await fetch(uploadUrl, {
method: 'PUT',
body: file,
headers: { 'Content-Type': 'application/pdf' },
});
import { TempsError, RateLimitError, NotFoundError } from '@temps-sdk/node';
try {
await temps.track('event', data);
} catch (error) {
if (error instanceof RateLimitError) {
// Retry after delay
await sleep(error.retryAfter * 1000);
await temps.track('event', data);
} else if (error instanceof NotFoundError) {
console.error('Resource not found:', error.message);
} else if (error instanceof TempsError) {
console.error('Temps error:', error.message, error.code);
} else {
throw error;
}
}
Full TypeScript support with generics:
interface User {
name: string;
email: string;
plan: 'free' | 'premium';
}
// Typed KV operations
const user = await kv.get<User>('user:123');
// user is User | null
await kv.set<User>('user:123', {
name: 'John',
email: '[email protected]',
plan: 'premium',
});
| Variable | Required | Description |
|----------|----------|-------------|
| TEMPS_API_KEY | Yes | API key from dashboard |
| TEMPS_PROJECT_ID | For tracking | Project ID for analytics |
| TEMPS_API_URL | No | Custom API URL (self-hosted) |
tools
Build external plugins for the Temps deployment platform. Use when the user wants to create, modify, or debug a Temps plugin binary — a standalone Rust process that communicates with Temps over a Unix domain socket. Also use when the user mentions "temps plugin", "external plugin", "plugin binary", "plugin for temps", "plugin UI", or asks about plugin architecture, plugin events, plugin manifest, or plugin SDK. Covers the full lifecycle: project scaffolding, manifest, router, events, SQLite persistence, embedded React UI, build.rs, testing, and deployment into the plugins directory.
tools
Install, configure, and manage the Temps deployment platform and CLI. Covers self-hosted Temps installation, CLI setup (bunx @temps-sdk/cli), initial configuration, user management, and platform administration. Use when the user wants to: (1) Install Temps on their server, (2) Set up the Temps CLI, (3) Configure Temps for the first time, (4) Manage Temps platform settings, (5) Create admin users, (6) Configure DNS providers, (7) Set up TLS certificates. Triggers: "install temps", "setup temps", "temps cli", "configure temps", "temps platform", "self-hosted deployment platform".
tools
Configure the Temps MCP server to enable AI assistants to interact with the Temps platform. Provides tools for listing projects, viewing project details, and managing deployments directly from Claude or other MCP-compatible clients. Use when the user wants to: (1) Set up Temps MCP server, (2) Configure Claude to manage Temps projects, (3) Add Temps tools to their AI assistant, (4) Enable AI-powered deployment management, (5) Connect Claude Desktop to Temps, (6) Use MCP to interact with Temps API. Triggers: "temps mcp", "configure temps tools", "add temps to claude", "temps ai assistant", "mcp server setup".
tools
Complete command-line reference for managing the Temps deployment platform. Covers all 54+ CLI commands including projects, deployments, environments, services, domains, monitoring, backups, security scanning, error tracking, and platform administration. Use when the user wants to: (1) Find CLI command syntax, (2) Manage projects and deployments via CLI, (3) Configure services and infrastructure, (4) Set up monitoring and logging, (5) Automate deployments with CI/CD, (6) Manage domains and DNS, (7) Configure notifications and webhooks. Triggers: "temps cli", "temps command", "how to use temps", "@temps-sdk/cli", "bunx temps", "npx temps", "temps deploy", "temps projects", "temps services".