NOTE
This is the Sanity Studio v3 version of sanity-plugin-asset-source-giphy.
Plugin for Sanity Studio providing asset source for retrieving gifs from Giphy!
In your studio folder, run:
npm install --save sanity-plugin-asset-source-giphy
or
yarn add sanity-plugin-asset-source-giphy
Add it as a plugin in sanity.config.ts (or .js), with a valid Giphy API key:
apiKey is required,
import { giphyAssetSourcePlugin } from "sanity-plugin-asset-source-giphy";
export default createConfig({
// ...
plugins: [
giphyAssetSourcePlugin({
apiKey: "my-api-key"
}),
],
});
We made some changes as we wanted the plugin to feel more like giphy's own page. Therefore the old config to opt in to autoplay of gifs is gone. In addition we now preview selected gif with related gifs. All options are no longer available. It was way too much to explain and most will only need a select few.
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.
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.