@buildingopen/client
JavaScript/TypeScript client for the RunIt API.
Install
npm install @buildingopen/client
Usage
import { RunitClient } from '@buildingopen/client';
const client = new RunitClient({
url: 'http://localhost:3001',
apiKey: 'your-api-key',
});
const project = await client.deploy(
'def run(city: str = "Berlin") -> dict:\n return {"message": f"Hello {city}"}',
'Greeter'
);
const run = await client.run(
project.id,
project.version_id,
project.endpoints[0].id,
{ json: { city: 'Hamburg' } }
);
const result = await client.waitForRun(run.run_id);
console.log(result.result?.json);
API
Core
deploy(code, name, requirements?, config?) - Deploy Python code or base64 ZIP
run(projectId, versionId, endpointId, params?) - Execute an endpoint
waitForRun(runId, timeoutMs?) - Poll until completion (default 120s)
getRunStatus(runId) - Get run status and result
listProjects() - List all projects
getProject(projectId) - Get project details with endpoint schemas
deleteProject(projectId) - Delete a project
Versions
listVersions(projectId) - List versions with dev/prod flags
promote(projectId, versionId?) - Promote to production
rollback(projectId, versionId) - Rollback
Secrets
listSecrets(projectId) - List configured secrets
setSecret(projectId, key, value) - Set a secret
deleteSecret(projectId, key) - Delete a secret
Storage
putStorage(projectId, key, value) - Store a value
getStorage(projectId, key) - Retrieve a value
deleteStorage(projectId, key) - Delete a value
listStorage(projectId) - List all keys
Share Links
createShareLink(projectId) - Create public share link
listShareLinks(projectId) - List share links
disableShareLink(projectId, shareId) - Disable a link
License
MIT