@dbbs/poeditor-sdk
v0.0.5
Published
POEditor SDK
Readme
POEditor SDK
TypeScript-first SDK for seamless integration with POEditor's localization platform
Features ✨
- Type-Safe Interactions - Full TypeScript support with strict typing
- Atomic Operations - Batch term/translation synchronization
- Enterprise Ready - Retry policies, caching, and error recovery
- Webhook Support - Built-in verification and event typing
- High API Coverage - Most of the POEditor endpoints implemented
Installation 📦
# Using yarn
yarn add @dbbs/poeditor-sdk
# Using npm
npm install @dbbs/poeditor-sdkQuick Start 🚀
Get API Token
Visit POEditor Account Settings
Generate API token
Store securely (recommended: environment variables)
Basic Usage
import { POEditorSDK } from '@dbbs/poeditor-sdk';
// Initialize with project ID and token
const sdk = new POEditorSDK(process.env.POEDITOR_TOKEN, 12345);
// Sync terms atomically
await sdk.syncTerms({
terms: [
{ term: 'welcome_message', context: 'greetings' },
{ term: 'error_404', context: 'errors' }
]
});
// Export French translations
const frenchTranslations = await sdk.exportProject({
language: 'fr',
type: 'json'
});API Reference 📖
| Category | Method | Parameters | Description |
|-----------|---------------------------|--------------------------------------|---------------------------------|
| Projects | listProjects() | - | List all accessible projects |
| Projects | exportProject() | { language: string, type: Format } | Export translations |
| Terms | syncTerms() | { terms: Term[] } | Atomic term synchronization |
| Terms | updateTerms() | { terms: UpdateTerm[] } | Batch term updates |
| Languages | addLanguageToProject() | { language: string, code?: string }| Add new project language |
View full api Documentation ->
Contributing 🤝
We welcome contributions! Please follow our workflow:
Fork the repository
Create feature branch (feat/your-feature)
Write tests for new functionality
Submit PR with:
- Description of changes - Updated documentation - Test coverage report
License 📜
The DBBS Poeditor SDK is open-source software licensed under the MIT License.
