# Web quickstart

Start a TypeScript project, pose an image, and generate a new view.

Turn a photo into a new viewpoint with Atlas. Run this on your server with
Node.js 24 and a [Developer API key](/quickstart).

For CLI setup and agent skill installation, see [CLI](/cli).

Read [How To Use Atlas](/how-to-use-atlas) before choosing model inputs or
combining tasks. For coordinate calculations, use [Cameras and posed
images](/cameras-and-posed-images).

To opt out of model training on your inputs, the account owner can open
[Settings → General](https://atlas.worldlabs.ai/settings/general) and turn off **Use my data to improve
models** for the relevant account. This setting covers both Studio and Developer
API projects in that account.

## 1. Install

Install the `latest` tag of the public
[TypeScript client](https://www.npmjs.com/package/@worldlabsai/client).

```bash
mkdir atlas-demo && cd atlas-demo
npm init -y
npm pkg set type=module
npm install @worldlabsai/client@latest
```

Create `.env` with `WLT_API_KEY=your_key_here` and add `.env` to `.gitignore`.

## 2. Generate a view

Save as `generate.ts`. The sample photo of a _torii_ gate is by
[Daniel Erlandson on Pexels](https://www.pexels.com/photo/scenic-view-of-red-torii-gate-at-lake-ashi-31252468/).

```ts
import { createClient } from "@worldlabsai/client";

const apiKey = process.env.WLT_API_KEY;
if (!apiKey) throw new Error("Set WLT_API_KEY in .env");
const wl = createClient({ apiKey });
const signal = AbortSignal.timeout(300_000);
const imageUrl =
  "https://images.pexels.com/photos/31252468/pexels-photo-31252468.jpeg?auto=compress&cs=tinysrgb&w=1280";

const posing = await wl.tasks.images2PosedRGBD(
  { frames: [{ imageAsset: { url: imageUrl } }], targetResolution: [1280, 720] },
  { signal },
);
const posed = await wl.operations.wait(posing, { signal });
if (posed.error) throw new Error(posed.error.message ?? "Posing failed");
const context = posed.response?.frames[0];
if (!context) throw new Error("Posing returned no frame");

const { imageAsset, camera, depth } = context;
const target = structuredClone(camera);
target.extrinsics.position[0] += 0.25;
const generation = await wl.tasks.atlasGenerate(
  {
    contextFrames: [{ imageAsset, camera, depth }],
    targetCameras: [target],
    prompt: "The same scene from a nearby viewpoint",
  },
  { signal },
);
const generated = await wl.operations.wait(generation, { signal });
if (generated.error) throw new Error(generated.error.message ?? "Generation failed");
const outputUrl = generated.response?.frames?.[0]?.imageAsset.url;
if (!outputUrl) throw new Error("Atlas returned no image URL");
console.log(outputUrl);
```

## 3. See the result

```bash
node --env-file=.env generate.ts
```

Open the printed URL to see the generated image. The camera moves 0.25 metres
along world X in the estimated scene. Metric scale is predicted, so physical
distances are approximate.

For a web app, run generation in a backend job and return its status to the
browser. Save operation IDs to resume polling and reuse an idempotency key for
retries of the same submission. A timeout stops local waiting; it does not
cancel the server task. See [How To Use Atlas](/how-to-use-atlas) for camera
controls and depth output.

For CPU processing of depth with Three.js, apply the
[EXR row mapping](/cameras-and-posed-images#decode-linear-depth-exr-rows)
before unprojecting or matching image pixels.

To display your exported scene in a browser, follow
[Web (Spark.js)](/rendering-with-spark).