Gawdfrey / sanity-plugin-asset-source-remove-bg

Remove the background of your images with the remove.bg API
MIT License
2 stars 0 forks source link

sanity-plugin-asset-source-remove-bg

NOTE

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

What is it?

Plugin for Sanity Studio providing asset source for removing the background of existing images with the Remove.bg API. Caution: The service offers 50 free preview images each month, which are of a lower quality, but you are able to purchase credits at their website. (I am not affiliated by any means with Remove.bg)

Features

What might be added

Installation

npm install --save sanity-plugin-asset-source-remove-bg

or

yarn add sanity-plugin-asset-source-remove-bg

Usage

Parameters:

 import {createConfig} from 'sanity'
 import {removeBgAssetSourcePlugin} from 'sanity-plugin-remove-bg-converter'

 export const createConfig({
     /...
     plugins: [
         removeBgAssetSourcePlugin({
             apiKey: "my-api-key",
             allowedUserRoles: ["administrator", "editor"]
         })
     ]
 })

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.

License

MIT © Rein Undheim See LICENSE