Create a session for tembo to start working on in the background
import Tembo from '@tembo-io/sdk';
const client = new Tembo({
apiKey: 'My API Key',
});
const session = await client.session.create({
prompt: 'Fix the authentication bug in the login component',
agent: 'claudeCode:claude-opus-4-5',
repositories: [
'https://github.com/org/repo',
'https://gitlab.com/org/repo-2',
],
targetBranch: 'dev',
branchName: "cooper-is-awesome",
});
console.log(session.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"htmlUrl": "https://app.tembo.io/sessions/123e4567-e89b-12d3-a456-426614174000"
}Session creation payload
Description of the session to be performed. Supports tagging files.
1"Fix the authentication bug in the login component"
Detailed description of the session (alternative to prompt)
1"Users are reporting they cannot log in. JWT token validation appears to be failing."
The agent to use for this session
"claudeCode:claude-opus-4-5"
Array of code repository urls that this session relates to
[
"https://github.com/org/repo",
"https://gitlab.com/org/repo-2"
]
Array of Tembo code repository IDs to target directly
[
"cbad4334-c844-4fef-a8da-d08f209f267e",
"6307d53a-b99d-4e90-ab89-f29114f33d53"
]
The branch to open the pull request against (e.g. main, develop)
"main"
The branch name to use for the work
"feature/auth-fix"
Whether to immediately queue the session for processing (optional, defaults to true)
false
Session created successfully
URL to view this session in the Tembo web application
"https://app.tembo.io/sessions/123e4567-e89b-12d3-a456-426614174000"
Was this page helpful?
import Tembo from '@tembo-io/sdk';
const client = new Tembo({
apiKey: 'My API Key',
});
const session = await client.session.create({
prompt: 'Fix the authentication bug in the login component',
agent: 'claudeCode:claude-opus-4-5',
repositories: [
'https://github.com/org/repo',
'https://gitlab.com/org/repo-2',
],
targetBranch: 'dev',
branchName: "cooper-is-awesome",
});
console.log(session.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"htmlUrl": "https://app.tembo.io/sessions/123e4567-e89b-12d3-a456-426614174000"
}