Full flow
Example app: Next.js + @genlook/api
Product grid, try-on widget and server-side routes. Clone it, add your key, run
pnpm dev.Client options
Every method also takes a last
options argument for that call only: signal (an AbortSignal), timeoutMs and maxRetries.
Methods
waitFor
Polls until the generation finishes. Returns the completed generation. ThrowsGenerationFailedError on FAILED and GenerationTimeoutError past timeoutMs.
pollIntervalMs for a fixed interval.
Errors
Every failed call throws aGenlookError subclass carrying code, status, details and requestId.
err.is("PRODUCT_NOT_FOUND") also works. Quote err.requestId when you contact support. All codes: Errors.
Uploads
images.upload accepts Blob, File, Buffer, Uint8Array, ArrayBuffer, a web ReadableStream or a Node Readable.
Before 0.2.0 these options were named
customerId and retentionDays. The old names still work.fileKey and pass the bytes in files:

