Skip to content

GIPHY Integration

Honeycomb integrates the GIPHY API to let users search and embed GIFs in messages and posts. The integration is entirely client-side — the browser calls the GIPHY search API directly using a public API key.

The API key is loaded from the public environment:

import { PUBLIC_GIPHY_API_KEY } from "$env/static/public";

Set this in your .env file:

PUBLIC_GIPHY_API_KEY=your_giphy_api_key_here

There are two GIF picker components, each tailored to a different context.

File: src/lib/modules/honeycomb/stickers/components/gif-search.svelte

A standalone search panel designed for the Honeycomb room sticker picker. It renders a search input and a grid of results.

Props:

PropTypeDescription
onSelect(gifUrl: string) => voidCallback fired when the user clicks a GIF

Behavior:

  • Debounces search input by 350 ms.
  • Calls https://api.giphy.com/v1/gifs/search with the query.
  • Limits results to 20 GIFs with a pg-13 rating.
  • Displays fixed_width_small thumbnails in a 2-column grid.
  • Returns the original URL to the onSelect callback.
EndpointUsed ByTrigger
GET /v1/gifs/searchBoth componentsUser types a search query
GET /v1/gifs/trendingGifPicker onlyDropdown opens with no query
ParameterValueNotes
api_keyPUBLIC_GIPHY_API_KEYRequired for all requests
qUser inputOnly for search endpoint
limit12 or 20Controls grid density
ratingpg or pg-13Content safety filter

Neither component sends messages directly. They both accept an onSelect callback and return a GIF URL. The parent component is responsible for embedding the URL into a message or post:

User clicks GIF
-> onSelect(gifUrl) fires
-> Parent inserts URL into message content or attachment
-> Message is sent through the normal send flow

In the Honeycomb rooms context, GifSearch is part of the sticker picker panel exported from src/lib/modules/honeycomb/stickers/index.js. In posts, GifPicker sits in the post composer toolbar alongside other media options.

FilePurpose
src/lib/modules/honeycomb/stickers/components/gif-search.svelteRoom sticker GIF search
src/lib/modules/post/components/gif-picker.sveltePost composer GIF dropdown