| name | gamma-sdk-patterns |
| description | Reusable patterns for the Gamma REST API (no SDK exists).
Use when building typed wrappers, generation helpers,
template factories, or error handling for Gamma.
Trigger: "gamma patterns", "gamma client wrapper",
"gamma best practices", "gamma API helper", "gamma code structure".
|
| allowed-tools | Read, Write, Edit |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","gamma","patterns","api"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Gamma API Patterns
Overview
Gamma has no published SDK — all interaction is via REST at https://public-api.gamma.app/v1.0/. This skill provides production-grade patterns for typed clients, generation helpers, polling, template workflows, and error handling.
Prerequisites
- Completed
gamma-install-auth setup
- TypeScript project with
fetch (Node.js 18+)
- Understanding of the generate-poll-retrieve workflow
Instructions
Step 1: Typed Client Singleton
const GAMMA_BASE = "https://public-api.gamma.app/v1.0";
interface GammaConfig {
apiKey: string;
baseUrl?: string;
timeoutMs?: number;
}
interface GenerateRequest {
content: string;
outputFormat?: "presentation" | "document" | "webpage" | "social_post";
themeId?: string;
exportAs?: "pdf" | "pptx" | "png";
textMode?: "generate" | "condense" | "preserve";
textAmount?: "brief" | "medium" | "detailed" | "extensive";
imageOptions?: { style?: string };
?: {
?: | | | | ;
?: | | | | ;
};
?: [];
}
{
: ;
: | | ;
?: ;
?: ;
?: ;
}
: < createGammaClient> | = ;
() {
(!instance) {
instance = ({
: process..!,
});
}
instance;
}
() {
base = config. ?? ;
: <, > = {
: config.,
: ,
};
request<T>(: , : , ?: ): <T> {
controller = ();
timeout = ( controller.(), config. ?? );
{
res = (, {
method,
headers,
: body ? .(body) : ,
: controller.,
});
(!res.) {
text = res.();
(res., text, path);
}
res.() T;
} {
(timeout);
}
}
{
:
request<{ : }>(, , body),
:
request<{ : }>(, , body),
:
request<>(, ),
:
request<{ : }>(, ),
: request<[]>(, ),
: request<[]>(, ),
};
}