*.mycompany.com) instead of the default OpenComputer hostnames:mycompany.com).*.mycompany.com pointing to the value provided by OpenComputer. This routes all subdomain traffic to your sandboxes.123git clone https://github.com/diggerhq/osslovable.git cd osslovable npm run install:all
.env file at the project root with your API keys:123ANTHROPIC_API_KEY=sk-ant-... OPENCOMPUTER_API_KEY=your-opencomputer-token DEPLOY_DOMAIN=mycompany.com # optional — defaults to openlovable.cc
DEPLOY_DOMAIN to that domain so that deployed apps are served under it (e.g. https://<id>.mycompany.com). If you skip this, deploy URLs will use the default openlovable.cc domain.1npm run dev
http://localhost:5173 in your browser, type a prompt, and watch your app get built.POST /api/generate.Sandbox.create() from the OpenComputer SDK to spin up an isolated Node.js environment.<file path="...">...</file>).sandbox.files.write().npm install and starts a Vite dev server inside the sandbox.sandbox.createPreviewURL({ port: 80 }) to get a public URL, which is sent to the frontend and displayed in an iframe.12345678910111213import { Sandbox } from "@opencomputer/sdk"; // Create an isolated environment const sandbox = await Sandbox.create({ template: "node", timeout: 600 }); // Write files await sandbox.files.write("/workspace/src/App.tsx", code); // Run commands await sandbox.exec.run("cd /workspace && npm install"); // Get a public URL const preview = await sandbox.createPreviewURL({ port: 80 });
node_modules) are copied from the dev sandbox to the deploy sandbox using the SDK's file APIs.npm install and starts the Vite dev server, just like the dev sandbox.sandbox.createPreviewURL() with a custom domain configuration, producing a stable URL (e.g. https://<id>.openlovable.cc) that can be shared with others.123456const domain = process.env.DEPLOY_DOMAIN || "openlovable.cc"; const url = await sandbox.createPreviewURL({ port: 80, domain, authConfig: {}, });
authConfig on preview URLs supports restricting access. Not full private link sharing yet, but a step toward it.