@lastshotlabs/slingshot-gifs
v0.0.2
Published
GIF search proxy for slingshot — swappable providers (Giphy, Tenor), server-side API key
Downloads
169
Readme
title: Human Guide description: Human-maintained guidance for @lastshotlabs/slingshot-gifs
@lastshotlabs/slingshot-gifs is a thin server-side proxy for GIF search providers. It keeps the
provider API key on the server, normalizes provider responses, and gives clients one stable
interface whether the backend is Giphy or Tenor.
When To Use It
Use this package when your app needs:
- GIF search and trending endpoints for chat, comments, or composer UIs
- provider API keys to remain server-side
- the ability to swap between Giphy and Tenor without changing client payload shape
Do not use it if you want clients to call provider APIs directly. This package exists to centralize credentials and response normalization.
Minimum Setup
The required config is:
provider: 'giphy' | 'tenor'apiKey
The optional config is:
ratinglimit, which defaults to25mountPath, which defaults to/gifs
The package has no additional Slingshot package dependencies.
What You Get
The plugin mounts:
GET {mountPath}/trendingGET {mountPath}/search?q=...
Both routes return normalized results with:
idurlpreviewwidthheighttitle
The API key never leaves the server. Clients only see the normalized result set.
Common Customization
The highest-value knobs are:
provider: choose the operational backendrating: align results with your product's content policylimit: set a stable page size for UI gridsmountPath: fit the route into your app's API layout
If you need to extend provider behavior, start in:
src/plugin.tsfor route behaviorsrc/types.tsfor the shared provider contractsrc/providers/giphy.tsandsrc/providers/tenor.tsfor backend-specific mapping
Gotchas
- Search requires the
qquery parameter and returns400when it is missing or blank. - Provider-specific rating vocabularies still apply. The plugin passes
ratingthrough rather than inventing a cross-provider moderation policy. - The plugin normalizes response shape, not every backend quirk. If you depend on provider-only fields, you are breaking the abstraction boundary.
Key Files
src/index.tssrc/plugin.tssrc/types.tssrc/providers/giphy.tssrc/providers/tenor.ts
