← All examples

Image Generation

Submit a room photo and the products to place in it — catalog ids, photos of the customer's own furniture, or a mix — watch the job's status live, and render the generated scene. All through dwm.images.generate()'s job handle: no polling, no endpoints.

Mock mode is on. Every DesignWithMe API call on this page is answered by a mock running inside the browser — no API key, and no request leaves the tab. The SDK is unchanged and the wire shapes are the real ones, but the results are canned fixtures, so read them as shapes rather than answers. Drop ?mock=1 from the URL to call the live service with your own key.

1Connect

There is no separate authenticate step — createDesignWithMe() signs in on its first real call below.

Settings persist across every example page for this browser tab. Change them, then reload the page to build a new client.

2Submit a generation job

The room photo, the products to composite (one entry per unit), and optional styling instructions.

A product is either a catalog item (send its id and the service resolves the asset) or a custom product (send a photo of it). Fill in either list, or both — a job made entirely of custom products needs nothing in your catalog.

3Job status & result

job.on('progress', ...) narrates the status as it advances; await job.result() resolves with the generated images once the job completes.

Activity feed

One subscription, dwm.on('activity', ...), sees every event this client emits — the same feed powers dwm.activity.log.