Skip to content
Skillv1.0.0

stackblitz-install-auth

Install the WebContainer API and configure StackBlitz SDK for browser-based Node.js. Use when setting up WebContainers, embedding StackBlitz projects, or initializing the @stackblitz/sdk package. Trig

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/stackblitz-install-auth/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill stackblitz-install-auth. Copyright stays with the author (MIT).

StackBlitz Install & Auth

Overview

Set up the WebContainer API for running Node.js in the browser, or the StackBlitz SDK for embedding interactive code editors. WebContainers require no auth -- they run entirely client-side. The StackBlitz SDK is for embedding projects from stackblitz.com.

Prerequisites

  • Node.js 18+ for build tooling
  • Modern browser with SharedArrayBuffer support (requires HTTPS + COOP/COEP headers)

Instructions

Step 1: Install WebContainer API

npm install @webcontainer/api

Step 2: Install StackBlitz SDK (for embedding)

npm install @stackblitz/sdk

Step 3: Configure Required HTTP Headers

WebContainers require cross-origin isolation. Add these headers to your server:

// Express middleware
app.use((req, res, next) => {
  res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
  res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
  next();
});
// Vite config
export default defineConfig({
  server: {
    headers: {
      'Cross-Origin-Embedder-Policy': 'require-corp',
      'Cross-Origin-Opener-Policy': 'same-origin',
    },
  },
});

Step 4: Verify WebContainer Boot

import { WebContainer } from '@webcontainer/api';

const wc = await WebContainer.boot();
console.log('WebContainer booted successfully');

// Verify filesystem works
await wc.mount({ 'test.txt': { file: { contents: 'Hello WebContainers!' } } });
const content = await wc.fs.readFile('/test.txt', 'utf-8');
console.log(`File content: ${content}`);

Output

WebContainer booted successfully
File content: Hello WebContainers!

Error Handling

Error Cause Solution
SharedArrayBuffer is not defined Missing COOP/COEP headers Add cross-origin isolation headers
Failed to boot Multiple instances Only one WebContainer per page
Not in secure context HTTP instead of HTTPS Use HTTPS or localhost

Resources

Next Steps

Proceed to stackblitz-hello-world for your first WebContainer project.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-stackblitz-in-dc3629/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-stackblitz-in-dc3629.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-stackblitz-in-dc3629",
  "kind": "skill",
  "name": "stackblitz-install-auth",
  "description": "Install the WebContainer API and configure StackBlitz SDK for browser-based Node.js. Use when setting up WebContainers, embedding StackBlitz projects, or initializing the @stackblitz/sdk package. Trigger: \"install stackblitz\", \"setup webcontainers\", \"stackblitz SDK\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "ide",
      "webcontainers",
      "stackblitz",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Install the WebContainer API and configure StackBlitz SDK for browser-based Node.js. Use when setting up WebContainers, embedding StackBlitz projects, or initializing the @stackblitz/sdk package. Trigger: \"install stackblitz\", \"setup webcontainers\", \"stackblitz SDK\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/stackblitz-install-auth/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/stackblitz-install-auth/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/stackblitz-install-auth/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# StackBlitz Install & Auth\n\n## Overview\n\nSet up the WebContainer API for running Node.js in the browser, or the StackBlitz SDK for embedding interactive code editors. WebContainers require no auth -- they run entirely client-side. The StackBlitz SDK is for embedding projects from stackblitz.com.\n\n## Prerequisites\n\n- Node.js 18+ for build tooling\n- Modern browser with SharedArrayBuffer support (requires HTTPS + COOP/COEP headers)\n\n## Instructions\n\n### Step 1: Install WebContainer API\n\n```bash\nnpm install @webcontainer/api\n```\n\n### Step 2: Install StackBlitz SDK (for embedding)\n\n```bash\nnpm ins",
  "cost": {
    "context_tokens": 577
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-stackblitz-in-dc3629/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.