Embed SDK
JavaScript SDK for embedding and controlling YaliCode editors programmatically.
Installation
Include the SDK via script tag or install from npm:
<script src="https://yalicode.dev/sdk.js"></script>Or with npm:
npm install @yalicode/sdkEmbed a project
YaliCode.embed('#editor', {
project: 'PROJECT_ID',
theme: 'dark',
height: '500px',
showFileTree: true,
showTerminal: false,
editable: true,
autoRun: false,
})Create a playground
YaliCode.create('#editor', {
language: 'python',
code: 'print("Hello from YaliCode!")',
theme: 'dark',
height: '400px',
})Options
| Option | Type | Description |
|---|---|---|
| project | string | Project ID to embed |
| language | string | Language for playground mode |
| code | string | Initial code for playground mode |
| theme | "dark" | "light" | "auto" | Editor theme |
| height | string | Container height (CSS value) |
| showFileTree | boolean | Show file tree sidebar |
| showTerminal | boolean | Show terminal panel |
| editable | boolean | Allow code editing |
| autoRun | boolean | Run code on load |