Very small Node.js / TypeScript client to fetch keywords for an Azbox project.
npm install azbox-nodeUse Node 18 or newer (relies on native
fetch).
import { AzboxClient } from "azbox-node";
const client = new AzboxClient({
apiKey: process.env.AZBOX_API_KEY!, // Azbox API key
projectId: "my-project-id", // Azbox project ID
language: "EN" // e.g. EN, ES, PT
});
async function main() {
const keywords = await client.getKeywords();
// keywords is an array of { id, data }
for (const kw of keywords) {
console.log(kw.id, kw.data.translation);
}
}
main().catch(console.error);The Azbox backend exposes on /v1/projects/:pid/keywords the parameter
afterUpdatedAtStr, which lets you fetch only the keywords updated after
a specific date.
import { AzboxClient } from "azbox-node";
const client = new AzboxClient({
apiKey: process.env.AZBOX_API_KEY!,
projectId: "my-project-id",
language: "ES"
});
// Example: only fetch changes since the last sync
const lastSync = new Date("2025-01-01T00:00:00.000Z");
const updatedKeywords = await client.getKeywords({
afterUpdatedAt: lastSync
});-
new AzboxClient(options)apiKey:string(required) – sent as?token=...on the query string.projectId:string(required) – Azbox project ID.language:string(required) – language code (for exampleEN,ES).baseUrl:string(optional) – defaults tohttps://api.azbox.io/v1.
-
client.getKeywords(options?)→Promise<AzboxKeyword[]>afterUpdatedAt:Date(optional) – if provided, sent asafterUpdatedAtStrin ISO format.- Returns the array coming from the backend API:
{ id: string, data: { translation?: string, context?: string, ... } }
This library does not implement any cache or persistence; it only wraps the HTTP call in a small, typed client.
Azbox has a monthly request limit, so it is strongly recommended that you:
- Cache the keywords in memory in your app, or
- Persist them in your own database and periodically sync using
afterUpdatedAt
This way you avoid hitting the Azbox API on every request of your application and you stay within your quota.