🔧 Install
npm install @localazy/api-client
🚀 Usage
ESM
import { ApiClient } from '@localazy/api-client';
const json = { en: { tooltip: 'Elegant unicorn' } };
const api = new ApiClient({ authToken: 'your-project-token' });
const project = await api.projects.first();
const file = await api.import.json({ project, json });
const fr = await api.export.json({ project, file, langs: ['fr'] });
console.log(fr);
TypeScript
import { ApiClient, Project, I18nJson, Locales } from '@localazy/api-client';
const json: I18nJson = { en: { tooltip: 'Elegant unicorn' } };
const api: ApiClient = new ApiClient({ authToken: 'your-project-token' });
const project: Project = await api.projects.first();
const file: File = await api.import.json({ project, json: json });
const fr: I18nJson = await api.export.json({ project, file, langs: [Locales.FRENCH] });
🔐 Project Token
You can obtain the project token at https://localazy.com/developer/tokens.
The project token is permitted to read and write to the single project.
📚 Documentation
ℹ️ Links
🛟 Support
Join the Localazy Discussion Forum to discuss all things localization.
If you encounter any problems or have questions, you can use our forum, GitHub issues or contact us at
team@localazy.com.
❤️ Localazy Ecosystem
Check out other npm packages from Localazy:
Discover all available integration options and localization examples.
📜 License
Code released under the MIT license.