@uthana/client
v0.3.0
Published
Uthana API client for JavaScript and TypeScript — works in browser and Node.js
Maintainers
Readme
@uthana/client
JavaScript/TypeScript client for Uthana: text and video to motion, characters, motions, and jobs. Runs in the browser and Node.js.
For React and TanStack Query hooks, use @uthana/react.
Install
npm install @uthana/client graffle graphqlgraffle and graphql are peer dependencies (required at runtime).
API key
Create an account at uthana.com, then copy your API key from account settings.
Quick start
import { UthanaClient } from "@uthana/client";
const client = new UthanaClient(process.env.UTHANA_API_KEY!);
const result = await client.ttm.create("a person waving");
console.log(result.motion_id);
const motions = await client.motions.list();Custom domain / timeout
const client = new UthanaClient(apiKey, {
domain: "custom.uthana.com",
timeout: 180,
});Errors
import { UthanaError } from "@uthana/client";
try {
await client.motions.download(characterId, motionId);
} catch (err) {
if (err instanceof UthanaError) {
console.error(err.statusCode, err.apiMessage);
}
}More examples
The Uthana JS/TS monorepo README includes longer examples (characters, jobs, React hooks overview, codegen, and publishing notes). Those examples apply to this client where noted, or to @uthana/react for React-specific APIs.
