Language
A kit is the primary container for pages and assets. Each kit can contain multiple versions and each version contains an "outline" made up of pages and headings.
If you are looking to fetch assets from any kit, you can jump to the documentation to fetch specific assets or use to query your asset library.
Returns a list of all kits in the space
Typescript
const kits = await lingo.fetchKits();
const brandKit = kits.find(k => k.name === "Brand");
Kit Properties
name
string
The name of the kit.
description
string
The description of the kit.
kitId
string
The unique identifier for the kit
privacy
string
private, public or password
spaceId
number • required
The id of the space that owns the kit.
status
string
The status of the kit (always `active`).
useVersion
string
The recommended version of the kit.
versions
Version[]
An array of versions in the kit. Which versions are included is determined by the `include` argument when fetching a kit.
Typescript
const kit = await lingo.fetchKit("<kitId>", "versions");
console.log(`${kit.name} has ${kit.versions.length} versions.`);
const recommendedVersion = kit.versions.find(v => v.version === kit.useVersion);
Arguments
kitId
string • required
The uuid for the kit.
include
string
'use_versions' (default) will include the draft and recommended versions, 'versions' will include all versions and null, no versions.
Kit Properties
name
string
The name of the kit.
description
string
The description of the kit.
kitId
string
The unique identifier for the kit
privacy
string
private, public or password
spaceId
number • required
The id of the space that owns the kit.
status
string
The status of the kit (always `active`).
useVersion
string
The recommended version of the kit.
versions
Version[]
An array of versions in the kit. Which versions are included is determined by the `include` argument when fetching a kit.
Kit Version Properties
kitId
string
The unique identifier for the kit the version is in.
version
number
The numeric version.
versionIdentifier
string
A string identifier of the version. (e.g. v1.0)
notes
string
Release notes provided for the version.
status
string
The status of the version (always `active`).
counts
object
Counts of `items`, `assets`, and `pages` in this version.
sections
Section[]
An array of pages in the version. Only included when fetching the kit outline.
Retrieve the outline of a kit. The outline includes the version information along with a list of pages and headers within each page.
Typescript
const outline = await lingo.fetchKitOutline("<kitId>", 0);
const { versionIdentifier, sections } = outline;
console.log(`Version ${versionIdentifier} has ${sections.length} pages`);
Arguments
kitId
string • required
The uuid for the kit.
version
Number • required
The version of the kit to fetch an outline of. Default 0
Kit Version Properties
kitId
string
The unique identifier for the kit the version is in.
version
number
The numeric version.
versionIdentifier
string
A string identifier of the version. (e.g. v1.0)
notes
string
Release notes provided for the version.
status
string
The status of the version (always `active`).
counts
object
Counts of `items`, `assets`, and `pages` in this version.
sections
Section[]
An array of pages in the version. Only included when fetching the kit outline.
Outline Page Properties
name
string
The name of the page.
version
string
The version of the page. (will always match the containing kit version)
shortId
string
A shortened version of the page id.
counts
object
Counts of assets and items on the page
displayOrder
number
The relative order of the page within the version.
headers
OutlineHeader[]
A list of headers on the page.
Outline Header Properties
name
string
The name of the heading.
version
string
The version of the heading. (will always match the containing page)
shortId
string
A shortened version of the UUID.
displayOrder
number
The relative order of the heading within the version.
Creating content requires an API token with write access enabled.
Create a new kit.
Returns the new kit
Typescript
const kit = await lingo.createKit("My Kit");
Arguments
name
string • required
The name for the new kit.