{"id":26309,"library":"repl-sdk","title":"repl-sdk","description":"repl-sdk is a runtime compiler library for building fast, extensible REPLs and interactive playgrounds in the browser. Current stable version is 1.6.0, released in April 2026 as part of the ember-repl monorepo. It uses es-module-shims and supports JavaScript, React, Vue, Svelte, Ember, Glimdown, and Mermaid out of the box. Key differentiators: on-demand async compilation (only pay for what you compile for), nested language support within Markdown, and a flexible plugin API for adding custom compilers/renderers. Unlike alternatives like CodeSandbox or RunKit, repl-sdk is designed for embedding in web apps with minimal overhead and full control over the compilation pipeline.","status":"active","version":"1.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/NullVoxPopuli/limber","tags":["javascript","repl","playground","SDK","render","play","live","interactive"],"install":[{"cmd":"npm install repl-sdk","lang":"bash","label":"npm"},{"cmd":"yarn add repl-sdk","lang":"bash","label":"yarn"},{"cmd":"pnpm add repl-sdk","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for shimming ES module imports in the browser","package":"es-module-shims","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require is not supported.","wrong":"const replSdk = require('repl-sdk')","symbol":"repl-sdk","correct":"import { createReplSdk } from 'repl-sdk'"},{"note":"Since v1.4.0, buildCompiler replaces the deprecated Compiler class.","wrong":"import { Compiler } from 'repl-sdk'","symbol":"buildCompiler","correct":"import { buildCompiler } from 'repl-sdk'"},{"note":"Exposed since v1.3.0. Returns a promise of a compiler module.","wrong":"","symbol":"markdownCompiler","correct":"import { markdownCompiler } from 'repl-sdk'"}],"quickstart":{"code":"import { createReplSdk } from 'repl-sdk';\n\nasync function main() {\n  const sdk = await createReplSdk();\n  const output = await sdk.compile({\n    code: `console.log('Hello, REPL!')`,\n    language: 'javascript',\n  });\n  console.log(output.code);\n}\n\nmain();","lang":"typescript","description":"Creates a REPL SDK instance, compiles a simple JavaScript expression, and logs the resulting code."},"warnings":[{"fix":"Use ES module import: import { ... } from 'repl-sdk'","message":"ESM-only: repl-sdk does not support CommonJS require(). Attempting to use require() will throw an error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use buildCompiler() instead: import { buildCompiler } from 'repl-sdk'","message":"buildCompiler replaces Compiler class: The Compiler class export was removed in v1.4.0.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Refer to documentation for adding custom compilers; expect possible breaking changes in minor versions.","message":"Nested language support may not work with all compiler combinations; the API for adding custom compilers is experimental.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always await the compilation result.","message":"Async compilation: compile() is async and returns a promise. Forgetting to await will lead to undefined behavior.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add type=\"module\" to your script tag: <script type=\"module\" src=\"app.js\"></script>","cause":"Using repl-sdk with a script tag or without type=\"module\".","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Ensure createReplSdk() is awaited: const sdk = await createReplSdk();","cause":"Trying to call compile() on a non-initialized or promised sdk instance before resolution.","error":"TypeError: replSdk.compile is not a function"},{"fix":"Install es-module-shims: npm install es-module-shims","cause":"Missing es-module-shims peer dependency.","error":"Module not found: Error: Can't resolve 'es-module-shims'"},{"fix":"Verify that createReplSdk() resolves and assign it correctly.","cause":"Calling compile on a misconfigured or missing sdk object.","error":"TypeError: Cannot read properties of undefined (reading 'compile')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}