API Reference
Complete method reference for all Admin SDK namespaces
import { createAdminClient } from '@better-i18n/admin'
const admin = createAdminClient({
apiKey: string, // Required — server-side API key (bi- prefix)
projectId: string, // Required — "org/project" slug format
apiUrl?: string, // Optional — default: "https://api.better-i18n.com"
debug?: boolean, // Optional — enable request logging
fetch?: typeof fetch, // Optional — custom fetch implementation
})
| Method | Returns |
|---|
list() | All projects in org |
get() | Current project details |
| Method | Input | Returns |
|---|
list(opts?) | { search?, namespace? } | Key list |
create(input) | { k: [{ n, v, ns? }] } | Created keys |
update(input) | { t: [{ id, l, t }] } | Updated translations |
delete(input) | { keyIds: string[] } | Deletion result |
| Method | Input | Returns |
|---|
get(opts?) | { namespaces?, keys? } | Translation data |
set(input) | { t: [{ id, t: { lang: text } }] } | Set result |
publish(opts?) | { translations? } | Publish result |
context(opts?) | { keyIds? } | Glossary + instructions |
pendingChanges() | — | Pending changes |
| Method | Input | Returns |
|---|
list(opts?) | — | Model list |
get(input) | { modelSlug } | Model detail |
create(input) | { slug, displayName, kind } | Created model |
update(input) | { modelSlug, ... } | Updated model |
delete(input) | { modelSlug } | Deletion result |
| Method | Input |
|---|
list(opts?) | { modelSlug, language?, search? } |
get(input) | { modelSlug, entrySlug } |
create(input) | { modelSlug, slug, title, body?, translations? } |
update(input) | { modelSlug, entrySlug, ... } |
publish(input) | { modelSlug, entrySlug } |
delete(input) | { modelSlug, entrySlug } |
duplicate(input) | { modelSlug, entrySlug } |
bulkCreate(input) | { modelSlug, entries: [...] } |
bulkUpdate(input) | { entries: [...] } |
bulkPublish(input) | { entryIds: [...] } |
| Method | Input | Returns |
|---|
views(model, entry?, opts?) | model: string, opts: { period? } | { views, period, cachedAt } |
stats(model, opts?) | opts: { period?, entrySlug? } | { overview, viewsByEntry, viewsByLanguage, viewsByCountry, viewsOverTime } |
| Method | Input |
|---|
list(opts?) | { limit? } |
get(input) | { syncId } |
cancel(input) | { syncId } |
| Method | Input |
|---|
add(input) | { languages: [{ code }] } |
update(input) | { updates: [{ languageCode, status }] } |
delete(input) | { languageCodes: [...] } |