Shopify + Sanity: Read about the investment and partnership –>

Asset source for Giphy

v3 Ready

Get hold of those animated GIFs right inside Sanity Studio

sanity-plugin-asset-source-giphy

NOTE

This is the Sanity Studio v3 version of sanity-plugin-asset-source-giphy.

What is it?

Plugin for Sanity Studio providing asset source for retrieving gifs from Giphy!

Giphy Asset Source Modal

Installation

In your studio folder, run:

npm install --save sanity-plugin-asset-source-giphy

or

yarn add sanity-plugin-asset-source-giphy

Usage

Add it as a plugin in sanity.config.ts (or .js), with a valid Giphy API key:

apiKey is required, meanwhile autoPlayAllowed is optional and defauls to false

import { giphyAssetSourcePlugin } from "sanity-plugin-asset-source-giphy";

export default createConfig({
  // ...
  plugins: [
    giphyAssetSourcePlugin({
      apiKey: "my-api-key",
      shouldAutoPlayPreview: false,
    }),
  ],
});

Develop & test

Make sure to run npm run build once, then run

npm run link-watch

In another shell, cd to your test studio and run:

npx yalc add sanity-plugin-asset-source-giphy --link && yarn install

Now, changes in this repo will be automatically built and pushed to the studio, triggering hotreload. Yalc avoids issues with react-hooks that are typical when using yarn/npm link.

About build & watch

This plugin uses @sanity/plugin-sdk with default configuration for build & watch scripts.

Studio Version

This plugin is available for Studio v3 and Studio v2.What are studio versions and which do I choose?

Categorized in