Improvement

SDKsdk 0.0.49Breaking

Plain SDK results for polling and webhooks

SDK results are serializable objects with task cost, successful media, and failures; webhook callbacks receive the same result shape.

Completed SDK calls now return plain objects. You can pass them to client components, server functions, and Convex mutations, or serialize them with JSON.stringify.

Update result access when upgrading to @mynthio/sdk@0.0.49:

BeforeNow
result.idresult.taskId
result.getImages()result.images
result.getVideos()result.videos
result.getMetadata()result.metadata
result.result.modelresult.model
result.result.magic_promptresult.magicPrompt
result.getImages({ includeFailed: true })Read successful images and errors in failures separately
image.mynth_urlimage.mynthUrl

Images from generation, upscaling, and background removal share width, height, format, mimeType, and delivery fields. url stays null when delivery fails, so choose image.url ?? image.mynthUrl when either URL works. raw.request and raw.result keep the API fields before mapping.

Framework webhook helpers now pass the same results as polling. Replace payload.task.id and payload.result.images with result.taskId and result.images. Failed callbacks receive a plain object with taskId and errors, plus request metadata when supported.

Result names such as ImageGenerationResult are type-only exports. Remove constructor calls and instanceof checks. Pending TaskAsync handles still use id and wait().

See generating media and webhooks.