Giphy
The giphy module lets editors search and import GIFs and stickers from Giphy through Brightspot's federated search.
Dependencies
Depends on db-http and the Giphy REST API v1 (api.giphy.com), called directly over HTTP.
Installation
- Maven
- Gradle
- Gradle (Kotlin DSL)
<!-- Requires Brightspot 5.0 or later. -->
<dependency>
<groupId>com.brightspot.dbhttp</groupId>
<artifactId>giphy</artifactId>
<version>1.0.0</version>
</dependency>
// Requires Brightspot 5.0 or later.
implementation 'com.brightspot.dbhttp:giphy:1.0.0'
// Requires Brightspot 5.0 or later.
implementation("com.brightspot.dbhttp:giphy:1.0.0")
API reference
com.psddev.giphy.GiphyDatabase
Extends HttpDatabase. Searches Giphy's GIF or sticker search endpoint for a keyword, or returns trending results when the editor hasn't typed a keyword.
com.psddev.giphy.GiphyImage
Extends ExternalItem.
| Field | Type | Description |
|---|---|---|
title | String | The GIF's title. |
author | String | The GIF uploader. |
dateCreated | Date | When the GIF was created in Giphy. |
rating | String | The content rating, defaulting to PG-13 when unfiltered. |
giphyId | String | The Giphy Id. |
previewUrl | String | A preview image URL. |
source | String | The GIF's source URL. |
gifType | GiphyGifType | Whether the result is a GIF or a sticker. Filterable in search. |
contentRating | GiphyContentRating | The content rating (Y, G, PG, PG13, or R). Filterable in search. |
Configuration
The API key is stored on GiphySettings, a Modification<CmsTool> shown under Site Settings > Integrations > Giphy. GiphySettings also has a useStillImages toggle that shows a still image instead of an animated preview in search results. Giphy is hidden from search entirely until an API key is set.
Extending the plugin
The module doesn't ship a content type for imported GIFs. To let editors create one from search results, define a content type and extend ExternalItemConverter<GiphyImage, T> to convert the external item into it on import.