lokalise-sdk-patterns

Featured

Apply production-ready Lokalise SDK patterns for TypeScript and Node.js. Use when implementing Lokalise integrations, refactoring SDK usage, or establishing team coding standards for Lokalise. Trigger with phrases like "lokalise SDK patterns", "lokalise best practices", "lokalise code patterns", "idiomatic lokalise".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Lokalise SDK Patterns ## Overview Production-grade patterns for `@lokalise/node-api`: client singleton, cursor pagination, typed error handling, batch operations, upload monitoring, and retry with rate limiting. ## Prerequisites - `@lokalise/node-api` v12+ installed - TypeScript 5+ with `strict` mode ## Instructions 1. Create a client singleton to centralize configuration and support branch-based project IDs. ```typescript // src/lib/lokalise-client.ts import { LokaliseApi } from "@lokalise/node-api"; let instance: LokaliseApi | null = null; export function getClient(apiKey?: string): LokaliseApi { if (instance) return instance; const key = apiKey ?? process.env.LOKALISE_API_TOKEN; if (!key) throw new Error("Set LOKALISE_API_TOKEN or pass apiKey"); instance = new LokaliseApi({ apiKey: key, enableCompression: true }); return instance; } export function resetClient(): void { instance = null; } /** Lokalise branch syntax: "projectId:branchName" */ export function projectId(id: string, branch?: string): string { return branch ? `${id}:${branch}` : id; } ``` 2. Build a cursor-based pagination helper that works with any paginated endpoint. ```typescript // src/lib/paginate.ts interface PaginatedResult<T> { items: T[]; hasNextCursor(): boolean; nextCursor(): string; } type Fetcher<T> = (params: Record<string, unknown>) => Promise<PaginatedResult<T>>; /** Async generator yielding all items across pages with rate-limit spacing. */ export async functi...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category