Skip to content
E2B Docs
Examples

Expo app

Expo web app running in the sandbox using Node.js

Basic Expo app.

The development server runs on port 8081 as soon as the sandbox is ready.

// template.ts
import { defaultBuildLogger, waitForURL } from "e2b";

export const template = Template()
  .fromNodeImage()
  .setWorkdir("/home/user/expo-app")
  .runCmd("npx create-expo-app@latest . --yes")
  .runCmd("mv /home/user/expo-app/* /home/user/ && rm -rf /home/user/expo-app")
  .setWorkdir("/home/user")
  .setStartCmd("npx expo start", waitForURL("http://localhost:8081"));
// build.ts
import { Template, defaultBuildLogger } from 'e2b'
import { template as expoTemplate } from './template'

Template.build(expoTemplate, 'expo-app', {
  cpuCount: 4,
  memoryMB: 8192,
  onBuildLogs: defaultBuildLogger(),
})
Was this page helpful?Suggest editsRaise issue