Sdk Embedding logo

Sdk Embedding

OrganizationPopular
live-codes
sdk-embedding

Create and configure embedded playgrounds using createPlayground(), EmbedOptions, container setup, loading modes (eager/lazy/click), and appUrl for self-hosted instances. Load this skill when embedding LiveCodes in web pages, configuring playground containers, or setting up SDK integration.

Overview

Publisherlive-codes
Repositorylivecodes
Skill namesdk-embedding
Stars
1.5K
Forks
271
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by live-codes on GitHub. Read the source before you install it.

Installation

Install the Sdk Embedding AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/live-codes/livecodes/tree/develop/.agents/skills/livecodes/sdk-embedding
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/live-codes/livecodes.git /tmp/livecodes
mkdir -p .claude/skills
cp -r /tmp/livecodes/.agents/skills/livecodes/sdk-embedding .claude/skills/sdk-embedding
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sdk Embedding in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sdk Embedding on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sdk Embedding is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

LiveCodes — Create Embedded Playground

LiveCodes is a client-side code playground that runs in the browser. Use createPlayground to embed interactive code editors in any web page.

Setup

javascript
import { createPlayground } from 'livecodes';

// Minimal embed with template
createPlayground('#container', {
  template: 'react',
});

// Embed with custom code
createPlayground('#container', {
  config: {
    markup: { language: 'html', content: '<h1>Hello World</h1>' },
    style: { language: 'css', content: 'h1 { color: blue; }' },
    script: { language: 'javascript', content: 'console.log("Hello");' },
  },
});

// CDN usage (no bundler)
import { createPlayground } from 'https://cdn.jsdelivr.net/npm/livecodes';
createPlayground('#container', { template: 'vue' });

Core Patterns

Load playground lazily

Playgrounds load when they approach the viewport by default. Use loading: 'eager' for immediate load or loading: 'click' for click-to-load.

javascript
createPlayground('#container', {
  template: 'react',
  loading: 'click', // Shows "Click to load" screen
});

Configure via query params

For simple cases, use URL-style params instead of full config objects.

javascript
createPlayground('#container', {
  params: {
    html: '<h1>Hello</h1>',
    css: 'h1 { color: blue; }',
    js: 'console.log("Hello")',
    console: 'open',
  },
});

Use self-hosted instance

Point to your own LiveCodes deployment.

javascript
createPlayground('#container', {
  appUrl: 'https://playground.mywebsite.com',
  template: 'react',
});

Multiple sources priority

When providing multiple config sources, they override in order: template < import < config < params.

javascript
createPlayground('#container', {
  template: 'react', // Lowest priority
  import: 'https://gist.github.com/...', // Overrides template
  config: {
    /* ... */
  }, // Overrides import
  params: { js: '...' }, // Highest priority
});

Generate shareable URL

Create a link to the standalone app without embedding.

javascript
import { getPlaygroundUrl } from 'livecodes';

const url = getPlaygroundUrl({
  config: {
    markup: { language: 'markdown', content: '# Hello World' },
  },
});
// url = "https://livecodes.io/#config/..."

Compress config for sharing

Compress a stringified config object for use in URL hashes or compact storage.

javascript
import { compress } from 'livecodes';

const config = {
  markup: { language: 'html', content: '<h1>Hello World</h1>' },
};
const compressed = compress(JSON.stringify(config));

Decompress config

Decompress a string that was compressed with compress. Returns null if decompression fails.

javascript
import { decompress } from 'livecodes';

const decompressed = decompress(compressedString);
if (decompressed) {
  const config = JSON.parse(decompressed);
}

Common Mistakes

HIGH Container element not found throws error

Wrong:

javascript
createPlayground('#nonexistent-container', { template: 'react' });
// Throws: "Cannot find element: \"#nonexistent-container\""

Correct:

javascript
// Ensure container exists before calling
const container = document.querySelector('#container');
if (container) {
  createPlayground('#container', { template: 'react' });
}

// Or use headless mode (container optional)
createPlayground({
  view: 'headless',
  config: {
    /* ... */
  },
});

createPlayground throws if the container selector matches no elements. In headless mode (headless: true), the container parameter is optional.

Source: src/sdk/index.ts — throws "Cannot find element" for invalid container

HIGH Calling SDK methods after destroy() throws error

Wrong:

javascript
const playground = await createPlayground('#container', options);
await playground.destroy();
await playground.run(); // Throws: "Cannot call API methods after calling `destroy()`."

Correct:

javascript
const playground = await createPlayground('#container', options);
await playground.run();
// Use SDK methods while playground exists...
await playground.destroy(); // Last call — no more methods after this

Once destroy() is called, all subsequent SDK method calls throw with the message "Cannot call API methods after calling destroy()."

Source: src/sdk/index.ts — alreadyDestroyedMessage constant

MEDIUM Invalid appUrl throws error

Wrong:

javascript
createPlayground('#container', {
  appUrl: 'my-playground', // Not a valid URL
});
// Throws: "my-playground is not a valid URL."

Correct:

javascript
createPlayground('#container', {
  appUrl: 'https://playground.example.com',
  template: 'react',
});

The appUrl must be a parseable URL string. Use the full URL including protocol.

Source: src/sdk/index.ts — URL parsing in getPlaygroundUrl

MEDIUM SDK method timeout after 60 seconds

SDK calls timeout after 60 seconds if the playground doesn't respond.

javascript
// This can timeout if playground has infinite loop or slow WASM load
await playground.run(); // Times out after 60s

Handle with try/catch for long-running operations:

javascript
try {
  await playground.run();
} catch (error) {
  if (error.message.includes('timed out')) {
    console.error('Playground timed out');
  }
}

Source: src/sdk/index.ts — API_TIMEOUT = 60_000 (60 seconds)

Frequently asked questions

What does the Sdk Embedding AI skill do?

Create and configure embedded playgrounds using createPlayground(), EmbedOptions, container setup, loading modes (eager/lazy/click), and appUrl for self-hosted instances. Load this skill when embedding LiveCodes in web pages, configuring playground containers, or setting up SDK integration.

Why use Sdk Embedding on TypingMind?

Because you install it once and use it with any model. Sdk Embedding is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sdk Embedding in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/live-codes/livecodes/tree/develop/.agents/skills/livecodes/sdk-embedding. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sdk Embedding?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sdk Embedding?

As many as you like. As long as a model supports skills, you can use Sdk Embedding with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sdk Embedding AI skill free?

Yes. It is published on GitHub by live-codes under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇