import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const response = await client.workers.flows.versions.commit('flowId', {
workerId: 'workerId',
commitMessage: 'commitMessage',
});
console.log(response.id);{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"flowId": "<string>",
"versionNumber": 123,
"code": "<string>",
"variables": {},
"commitMessage": "<string>",
"authorType": "USER",
"authorUserId": "<string>",
"authorApiKeyId": "<string>"
}Creates a snapshot of the current flow code and variables as a new version
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const response = await client.workers.flows.versions.commit('flowId', {
workerId: 'workerId',
commitMessage: 'commitMessage',
});
console.log(response.id);{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"flowId": "<string>",
"versionNumber": 123,
"code": "<string>",
"variables": {},
"commitMessage": "<string>",
"authorType": "USER",
"authorUserId": "<string>",
"authorApiKeyId": "<string>"
}API key authentication
Version created