Use this pre-built prompt to get an agent writing SudoMock Node calls correctly.
Prerequisites
Before you start, you’ll need:- A SudoMock API key
- A PSD reachable over HTTPS
Guide
1
Install
Get Express and the SudoMock Node SDK.
2
Render from a route
The route takes an artwork URL and answers with the finished image, using
the key and the two UUIDs an upload returned.
.env
server.mjs
The handler runs on Express 4 and 5. Mount
express.json() before the
route, or req.body is undefined by the time the handler reads it, and
read it as req.body ?? {}, because Express 5 leaves it undefined when a
request carries no JSON. Express 4 does not hand a rejected promise to
the error middleware, which is why the handler calls next(error)
itself. A client side failure, such as a timed out connection, reports
status as 0, so the middleware answers 502 instead. Raise the
express.json() limit if you post artwork inline as base64.Examples
Create a mockup from a PSD
The call behind
uploads.createRender a PSD mockup
Every field of
renders.createRetrieve the current account
Check a key before serving traffic
Error codes
Every code and its retry rule
Create a webhook endpoint
Deliver a background render
Fit and blend modes
How artwork meets a print area