Use this pre-built prompt to get started faster.
Prerequisites
Before you start, you will need:- A SudoMock API key
- An uploaded PSD mockup
Guide
1
Install
Get the SudoMock Node SDK.
2
Add your key
Put the key in
.env.local, which Next.js loads for you. Leave the
NEXT_PUBLIC_ prefix off, since it inlines the value into the browser
bundle..env.local
3
Render from a route handler
Create a route file under
app/api/render/route.ts, or
pages/api/render.ts if you are using the Pages Router. Both UUIDs come
from your upload.A connection failure or a client side timeout reports
status as 0,
which is why the handler falls back to 502. A synchronous render holds
the response open until the image is ready, so a route with a short
maximum duration is better off passing isAsync: true and taking the
finished image from a webhook.Next steps
Render a PSD mockup
Every field on the render call
Create a mockup from a PSD
Upload a template and read its UUIDs
Fit and blend modes
How artwork meets the print area
Text layers
Swap copy on the same template
Webhooks
Get called back when a background render finishes
Errors
Every status and error code, and which ones retry