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-ai-string

v1.0.0

Published

A Strapi Custom Field for Text Generation with AI.

Downloads

6

Readme

Strapi AI Text Generation Custom Feild with Open AI

With this Custom Field, you can leverage Open AI to generate CMS content for your products, webistes, blogs or whatever your heat desires.

✨ Coming Soon

  • Change the number of words the API generates
  • Change the langauge model used for text generation

🔧 Installation

Inside your Strapi Application, add the package

With npm

npm install strapi-ai-string

or yarn

yarn add strapi-ai-string

Then get your Open AI API Token here and add it to the .env file at the root of your project as OPEN_AI_API_TOKEN. Next, in ./config, create a file called plugins.js to enable the plugin.

// ...
    'ai-string': {
      enabled: true,
      config: {
        apiToken: process.env.OPEN_AI_API_TOKEN,
      },
    },
//...

After, build your admin with

npm run build

or

yarn build

and start your server with

npm run develop

or

yarn develop

and now you have the power of Open AI, right in your favourite CMS. For more on how to enable Custom Feilds in your content Model, have a look at this video on "How to install and use Strapi custom fields".

🛠 Contributing

In this section, we'll look at how YOU can contribute to this Custom Field.

Setting up the environment

Start by creating a new Strapi project.

npx create-strapi-app --quickstart strapi-plugin-dev
cd strapi-plugin-dev

Create a new plugins folder if it doesn't exist already.

mkdir -p src/plugins

Now we should clone this repository so you can work on it.

git clone https://github.com/malgamves/strapi-open-strapi-ai-string.git src/plugins/strapi-ai-string

Install project dependencies

yarn install

Now we need to register plugin so strapi can use it. In order to do that we need to create (if not already created) ./config/plugins.js file and add entry to it.

// ...
    'strapi-ai-string': {
      enabled: true,
      config: {
        apiToken: process.env.OPEN_AI_API_TOKEN,
      },
      resolve: './src/plugins/strapi-ai-string'
    },
// ...

When contributing, you need to change the value of the fetch() url below https://github.com/malgamves/strapi-open-strapi-ai-string/blob/78e692b214fc51f8de6bbf6a76fca4db767411eb/admin/src/components/Input/index.js#L25 to http://localhost:1337

Rebuild the project and start the server

yarn build
yarn develop

For an optimum development experience, start your Strapi server in Watch Mode so you don't have to build everytime you make changes as show below

yarn develop --watch-admin

Thanks to the team at CKEditor, the format of this Readme is inspired by theirs.