Run the Desktop Sandbox JavaScript Example
mainTo run the basic JavaScript example which demonstrates using the Desktop Sandbox SDK for streaming and mouse interaction within an Electron app, follow these steps:
- Prepare environment variables: Copy the example environment file to
.env. - Configure API Key: Obtain an API key from e2b.dev/dashboard and add it to your
.envfile using theE2B_API_KEYkey. - Install dependencies: Use
npm installto set up the project. - Execute: Run the example using
npm start.
# 1. Create .env file
cp .env.example .env
# 2. Set E2B_API_KEY in .env file
echo 'E2B_API_KEY="your_api_key"' >> .env
# 3. Install dependencies
npm install
# 4. Run
npm start