wc-api-standalone
v1.5.3-standalone
Published
WC Public API - Standalone Version (No Dependencies)
Maintainers
Readme
WebContainer API - Standalone Version
This is a standalone version of the WebContainer API that has been modified to remove dependencies on StackBlitz's authentication and API services.
Changes Made
Removed Authentication Requirements
- The package no longer requires authentication with StackBlitz
- The auth module has been replaced with a dummy implementation that always returns successful states
- OAuth flow has been completely removed
Local Resources
- The iframe URL now points to the local origin instead of StackBlitz
- All references to StackBlitz's servers have been removed
Simplified Implementation
- Token handling has been simplified to dummy implementations
- Authentication checks have been removed from the boot process
Usage
You can use this modified version of the WebContainer API in the same way as the original, but without needing to call auth.init() or handle authentication flows.
import { WebContainer } from '@webcontainer/api';
// No need for auth.init() anymore
// Boot the WebContainer
const webcontainer = await WebContainer.boot();
// Use as normal
const files = {
'index.js': {
file: {
contents: 'console.log("Hello, World!");',
}
}
};
await webcontainer.mount(files);Important Notes
- This modified version requires you to provide your own implementation of the WebContainer runtime
- You'll need to serve a compatible
/headlessendpoint on your server - This is not compatible with StackBlitz's hosted services
Limitations
Since this package no longer uses StackBlitz's services, you'll need to provide your own implementation of:
- The Node.js runtime environment
- The file system implementation
- The process spawning mechanism
This modified package is primarily intended for developers who want to run their own WebContainer-compatible environment without relying on StackBlitz's infrastructure.
API Reference Changes
The api_reference.json file has been updated to reflect the changes made to the package. The main modifications include:
- Removed references to StackBlitz and WebContainer API URLs
- Updated the AuthAPI interface to reflect the simplified authentication mechanism
- Modified documentation to reference local resources instead of external services
For a detailed list of changes, see the API_REFERENCE_CHANGES.md file included in this package.
