Authentication
When your workflows and agents interact with external APIs or user-specific data, they need a way to authenticate. The Culvii Kit provides a simple way to pass tokens when deploying workflows and configuring steps.
Deploying with tokens
You can pass authentication tokens when deploying your workflow using the save method. This authenticates your request to the Culvii platform.
import { Workflow } from '@culvii/kit';
const workflow = new Workflow({ name: 'My Workflow' });
// Inside your deployment script
await workflow.save({
baseUrl: 'https://api.culvii.com',
cloneId: 'your-clone-id',
workbookId: 'your-workbook-id',
token: 'user-jwt-token-here'
});
Using credentials in steps
When defining a step that interacts with external services, you can configure it to use credentials stored on the platform.
import { Step } from '@culvii/kit';
const fetchUserData = new Step({
name: 'Fetch User Data',
type: 'http',
credentials: {
name: 'My API Auth',
id: 'credential-id-here'
},
params: {
url: 'https://api.example.com/user',
method: 'GET'
}
});
Keep your tokens secure. Never hardcode them in your workflow definitions. Always pass them in at runtime from your secure backend or environment variables.