# Install and a five-minute example

> @faustine-ai/browser-sandbox documentation · https://browser-sandbox.faustine.ai/docs/getting-started/ · source: README.md on GitHub (https://github.com/faustine-ai/browser-sandbox)

```sh
npm install @faustine-ai/browser-sandbox
```

Everything runs in the browser; there is no server part. The quickest
start uses `srcdoc` mode, which needs nothing served:

```ts
import { createSandbox, defineFunctions } from '@faustine-ai/browser-sandbox';

const sandbox = createSandbox({ frame: { srcdoc: true }, warm: true });

const functions = defineFunctions({
  'orders.list':   (input) => api.orders.list(input),
  'orders.cancel': { call: (input) => api.orders.cancel(input), approval: true },
});

const result = await sandbox.run({
  code: `
    const open = await sdk.orders.list({ status: "open" });
    return open.filter(o => o.total > 100).map(o => o.id);
  `,
  functions,
});

if (result.status === 'ok') console.log(result.value);
```

The code runs as the body of an `async` function with `sdk` (the function
tree) and `console` in scope. `return` and `await` work as in any function.
