Transformers
(Remote) Transformers are meant specifically for Git sync integration. They allow you to use remote endpoints to process the content in a custom way, in and out of Vrite. This way Vrite can support all kinds of content formats, including Markdown, MDX, Markdoc, etc. The API allows you to retrieve and manage transformers.
List Transformers
Lists the details of all registered transformers.
ID of the transformer
Label assigned to the transformer
URL of the input transformer
URL of the output transformer
Maximum batch size for the transformer
Whether the transformer is in use with Git sync
Whether the transformer is associated with an extension
curl --request GET \
--url "https://api.vrite.io/transformers/list" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.transformers.list();
[
{
"id": "28c17701360e74c880edd4f5",
"label": "string",
"input": "string",
"output": "string",
"maxBatchSize": 1000,
"inUse": true,
"extension": true
}
]
Create Transformer
Creates a new transformer with the specified input and output transformer endpoints, label, and max batch size.
Label assigned to the transformer
URL of the input transformer
URL of the output transformer
Maximum batch size for the transformer
ID of the transformer
curl --request POST \
--url "https://api.vrite.io/transformers" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"label": "{LABEL}",
"input": "{INPUT}",
"output": "{OUTPUT}",
"maxBatchSize": "{MAXBATCHSIZE}"
}'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.transformers.create({
label: "string",
input: "string",
output: "string",
maxBatchSize: 1000,
});
{
"id": "91d43435abf71aa34d3ab602"
}
Delete Transformer
Deletes the transformer specified by ID. If the transformer is in use (configured in the current Git sync configuration) it throws an error.
ID of the transformer
curl --request DELETE \
--url "https://api.vrite.io/transformers?id={ID}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
await client.transformers.delete({
id: "50a84b1e854474a50eb34c53",
});