@lastshotlabs/slingshot-gifs
npm install @lastshotlabs/slingshot-gifs
Functions
Section titled “Functions”createGifsPlugin
Section titled “createGifsPlugin”function createGifsPlugin(rawConfig: unknown): SlingshotPluginSource: packages/slingshot-gifs/src/plugin.ts
createGiphyProvider
Section titled “createGiphyProvider”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; }): GifProviderSource: packages/slingshot-gifs/src/providers/giphy.ts
createKlipyProvider
Section titled “createKlipyProvider”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; }): GifProviderSource: packages/slingshot-gifs/src/providers/klipy.ts
createTenorProvider
Section titled “createTenorProvider”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; }): GifProviderSource: packages/slingshot-gifs/src/providers/tenor.ts
Constants
Section titled “Constants”gifsPluginConfigSchema
Section titled “gifsPluginConfigSchema”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
Interfaces
Section titled “Interfaces”GifProvider
Section titled “GifProvider”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
GifResult
Section titled “GifResult”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
GifSearchOptions
Section titled “GifSearchOptions”Source: packages/slingshot-gifs/src/types.ts
GifsPluginConfig
Section titled “GifsPluginConfig”Configuration for the slingshot-gifs plugin.
Validated at plugin creation time via the companion Zod schema.
Source: packages/slingshot-gifs/src/types.ts