TypeScript SDK
SDK Quickstart
Get started with the TypeScript SDK in 5 minutes
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get started with the TypeScript SDK in 5 minutes
bun add buntime.sh
import { Buntime } from 'buntime.sh';
const client = new Buntime({
apiKey: process.env.BUNTIME_API_KEY
});
const session = await client.sessions.create();
console.log('Session ID:', session.id);
const result = await client.execute({
sessionId: session.id,
code: `
const sum = [1, 2, 3, 4, 5].reduce((a, b) => a + b, 0);
console.log('Sum:', sum);
`
});
console.log(result.stdout); // "Sum: 15"
await client.files.write({
sessionId: session.id,
path: 'hello.ts',
content: 'export const greet = (name: string) => `Hello, ${name}!`;'
});
const result = await client.execute({
sessionId: session.id,
code: 'import { greet } from "./hello"; console.log(greet("World"));'
});
await client.sessions.delete({ sessionId: session.id });