Skip to content

@lastshotlabs/slingshot-gifs

npm install @lastshotlabs/slingshot-gifs

function createGifsPlugin(rawConfig: unknown): SlingshotPlugin

Source: packages/slingshot-gifs/src/plugin.ts

Create a Giphy-backed GifProvider.

The API key is closure-owned and never exposed in responses. All HTTP calls use the global fetch() provided by Bun.

function createGiphyProvider(config: { apiKey: string; rating?: string; limit?: number; fetchTimeoutMs?: number; }): GifProvider

Source: packages/slingshot-gifs/src/providers/giphy.ts

Create a KLIPY-backed GifProvider.

KLIPY exposes an officially supported Tenor-v2-compatible API at api.klipy.com. Only the normalized full-size and preview GIF formats are requested. The API key remains closure-owned and never reaches clients.

function createKlipyProvider(config: { apiKey: string; rating?: string; limit?: number; fetchTimeoutMs?: number; }): GifProvider

Source: packages/slingshot-gifs/src/providers/klipy.ts

Create a Tenor-backed GifProvider.

Tenor v2 uses key for the API key and client_key for app identification. The API key remains closure-owned and all HTTP calls use the runtime’s global fetch() implementation.

function createTenorProvider(config: { apiKey: string; rating?: string; limit?: number; fetchTimeoutMs?: number; }): GifProvider

Source: packages/slingshot-gifs/src/providers/tenor.ts

Zod schema for GifsPluginConfig.

Used by validatePluginConfig at plugin creation time to parse and validate raw user-supplied config.

Source: packages/slingshot-gifs/src/types.ts

The provider contract for GIF search backends.

Each provider implementation (Giphy, KLIPY, or Tenor) satisfies this interface. The plugin resolves a single provider at startup and delegates all search/trending calls through it.

Source: packages/slingshot-gifs/src/types.ts

A single GIF result returned by a provider.

Fields are normalized across providers so consumers never need to know which backend (Giphy, KLIPY, or Tenor) produced the result.

Source: packages/slingshot-gifs/src/types.ts

Source: packages/slingshot-gifs/src/types.ts

Configuration for the slingshot-gifs plugin.

Validated at plugin creation time via the companion Zod schema.

Source: packages/slingshot-gifs/src/types.ts