ugcinc
v4.6.2
Published
TypeScript/JavaScript client for the UGC Inc API
Downloads
2,279
Maintainers
Readme
ugcinc
Official TypeScript/JavaScript client for the UGC Inc API.
Use this README as a quick reference. For full API details, examples, onboarding, and product information, go to:
- Docs: https://docs.ugc.inc
- Website: https://ugc.inc
Installation
npm install ugcincQuick Start
import { UGCClient } from "ugcinc";
const client = new UGCClient({
apiKey: process.env.UGC_API_KEY!,
// optional: when using admin key, scope requests to a specific org
orgId: "org_123",
});
const res = await client.accounts.getAccounts({ status: "setup" });
if (res.ok) {
console.log(res.data.length);
}Authentication
apiKeyis required.- Standard API keys operate on their own organization.
- Admin keys can be scoped with
orgId.
Overview
UGCClient groups the API into a few top-level namespaces:
client.accounts: list, create, update, troubleshoot, and manage account lifecycleclient.posts: create video/slideshow posts, update them, retry failures, and preview schedule conflictsclient.media: upload media, create media records, manage tags/names, and work with social audioclient.stats: fetch account/post analytics, daily aggregates, top performers, and refresh statsclient.org: manage organizations, API keys, and integration keysclient.billing: inspect subscription state and handle account deactivation, replacements, and refundsclient.automations: create, run, publish, export, and monitor automation workflowsclient.commentsandclient.tasks: manage comment jobs and account tasks
The package also exports the API request/response types plus automation/render utilities used by the product.
Common Pattern
All client methods return the same response envelope:
type ApiResponse<T> =
| { ok: true; code: 200; message: string; data: T }
| { ok: false; code: number; message: string };Example:
const posts = await client.posts.getPosts({ accountIds: ["acc_123"] });
if (posts.ok) {
console.log(posts.data.length);
} else {
console.error(posts.code, posts.message);
}Useful Exports
UGCClientfor API access- Request/response types for all public client methods
- Automation graph utilities and node definitions
- Render helpers and render job types
Full Reference
For the full endpoint reference, all method signatures, data structures, and workflow examples:
- Docs: https://docs.ugc.inc
- Website: https://ugc.inc
License
MIT
