Skip to content

XSlemX/sanity-plugin-asset-source-giphy

Repository files navigation

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,

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

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

Changes since previous version

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.

Giphy Asset Source Modal

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-kit with default configuration for build & watch scripts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •