Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 2.34 KB

SKILL.md

File metadata and controls

80 lines (57 loc) · 2.34 KB
name gumlet-typescript-sdk
description TypeScript SDK for Gumlet API. Use when writing TypeScript code that calls Gumlet API with the @gumlet/nodejs-sdk package: installing it, constructing and authenticating the client, and calling API operations.

Gumlet TypeScript SDK

Generated TypeScript client for Gumlet API, published as @gumlet/nodejs-sdk. Use the generated client instead of hand-writing HTTP requests.

Install

npm install @gumlet/nodejs-sdk

Client setup and authentication

import Gumlet from '@gumlet/nodejs-sdk';

const client = new Gumlet({
  apiKey: process.env['API_KEY'], // defaults to the API_KEY env var
});

Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them:

  • apiKey (env: API_KEY) — Credential for the API_KEY scheme.

Calling operations

import Gumlet from '@gumlet/nodejs-sdk';

const client = new Gumlet({
  apiKey: process.env['API_KEY'], // defaults to the API_KEY env var
});

const videoAsset = await client.videoAssets.create({
  format: 'ABR',
  workspace_id: '<your workspace id>',
  title: 'Example Title',
  input: 'http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8',
});

console.log(videoAsset);

Method names, parameter shapes, and response types are generated from the API description — do not guess them. Look up the exact call signature in api.md before writing a call.

Error handling

Non-success responses throw generated API errors. Error objects expose status, headers, response body, and request metadata where the target runtime supports it.

import { APIError } from '@gumlet/nodejs-sdk';

try {
  const videoAsset = await client.videoAssets.create({
    format: 'ABR',
    workspace_id: '<your workspace id>',
    title: 'Example Title',
    input: 'http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8',
  });
} catch (err) {
  if (err instanceof APIError) {
    console.log(err.status, err.name, err.headers);
  }
  throw err;
}

Requirements

  • Node.js 20+, a modern browser, or any runtime with fetch support

Reference files

  • README.md — full feature tour: client options, request options, retries and timeouts, logging.
  • api.md — complete catalogue of every operation with request and response types.