@mynthio/sdk.
It is the easiest way to integrate Mynth from JavaScript or TypeScript applications.
What the SDK gives you
- a typed
Mynthclient - sync and async generation, rating, and alt text flows
ImageGenerationResult,ImageRateResult,ImageAltResult, andTaskAsyncabstractions- built-in polling for async tasks
- exported runtime model metadata through
AVAILABLE_MODELS - a Convex webhook helper in
@mynthio/sdk/convex
Installation
Typical server-side use
generate() runs synchronously and resolves once the task is complete, returning an ImageGenerationResult:
Typical async use
generateAsync() starts generation and returns a TaskAsync immediately, so your server can respond fast and poll or wait later:
When to use the SDK
Prefer the SDK when you want:- strong TypeScript support
- less boilerplate for polling
- consistent task handling
- first-class helpers for
mynth.image.generate,mynth.image.rate, andmynth.image.alt