npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-zeasy-image-api

v1.2.1

Published

Allow you to search and import image from Unsplash to the rich text field.

Downloads

16

Readme

Strapi plugin image-api

This is a plugin for strapi headless CMS It helps you to search for images on Unsplash and Giphy, import it to your media library and insert to your Rich Text content with appropriate attribution.

Screenshots

Import from Unsplash

Import from Giphy

Get Started

Option 1, with React based wysiwyg strapi plugin installed

Tested supported plugin

strapi-plugin-wysiwsg-react-md-editor

strapi-plugin-ckeditor

strapi-plugin-ckeditor5

  1. Install the package

With yarn:

yarn add strapi-plugin-zeasy-image-api

With npm:

npm install strapi-plugin-zeasy-image-api

  1. Config Unsplash

    1. Register an Unsplash account here
    2. Create an app on Unsplash, take a note on your app name and your Access Key, it will be used later. Note: there would be a limit of 50 requests per hour for a demo app
  2. Config Giphy

    1. Register a Giphy account here
    2. Create an API app on Giphy, take a note on your API Key, it will be used later. Note: there would be a rate limited to a maximum of 42 search requests an hour and 1000 search requests a day for a beta key.
  3. Generate a config file at config/plugins.js

module.exports = ({ env }) => {
  return {
    'zeasy-image-api': {
      providerOptions: {
        unsplash: {
          appName: env('UNSPLASH_APP_NAME'),
          accessKey: env('UNSPLASH_ACCESS_KEY'),
        },
        giphy: {
          accessKey: env('GIPHY_API_KEY'),
        },
      },
    },
  };
};

Then make sure you have below variables in your .env file

UNSPLASH_APP_NAME=XXXXXXX
UNSPLASH_ACCESS_KEY=XXXXXX
GIPHY_API_KEY=XXXXXX

Option 2, without React based wysiwyg strapi plugin installed

  1. Follow the same steps in option 1

  2. Create a file under this path /extensions/content-manager/admin/src/components/WysiwygWithErrors/index.js with the content here

The code will get the image api panel component

const {
    strapi: {
      componentApi: { getComponent },
    },
  } = useStrapi();
  const ImageApiPanel = getComponent('image-api-panel').Component;

Then you can render it to any place you want.

<ImageApiPanel editor={{ value, name }} onEditorChange={onChange} />