Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@strapi/helper-plugin

Package Overview
Dependencies
Maintainers
8
Versions
1147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strapi/helper-plugin

Helper for Strapi plugins development

  • 0.0.0-experimental.28515f333803ef8ef5ccb671171cac96399a4412
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
149K
decreased by-0.94%
Maintainers
8
Weekly downloads
 
Created

What is @strapi/helper-plugin?

@strapi/helper-plugin is a utility package designed to assist in the development of Strapi plugins. It provides a set of tools and components that streamline the process of creating and managing plugins within the Strapi ecosystem.

What are @strapi/helper-plugin's main functionalities?

API Requests

This feature allows you to make API requests easily within your Strapi plugin. The `request` function simplifies the process of sending HTTP requests and handling responses.

import { request } from '@strapi/helper-plugin';

const fetchData = async () => {
  try {
    const data = await request('/some-endpoint', { method: 'GET' });
    console.log(data);
  } catch (error) {
    console.error('Error fetching data:', error);
  }
};

fetchData();

Notification System

The notification system allows you to display notifications within your plugin. The `useNotification` hook provides a simple way to trigger notifications with different types and messages.

import { useNotification } from '@strapi/helper-plugin';

const MyComponent = () => {
  const toggleNotification = useNotification();

  const handleClick = () => {
    toggleNotification({ type: 'success', message: 'Operation successful!' });
  };

  return <button onClick={handleClick}>Click me</button>;
};

Form Handling

Form handling is made easier with the `useFormik` hook from @strapi/helper-plugin. It helps manage form state, validation, and submission.

import { useFormik } from '@strapi/helper-plugin';

const MyForm = () => {
  const formik = useFormik({
    initialValues: { name: '' },
    onSubmit: values => {
      console.log('Form data:', values);
    },
  });

  return (
    <form onSubmit={formik.handleSubmit}>
      <input
        type="text"
        name="name"
        value={formik.values.name}
        onChange={formik.handleChange}
      />
      <button type="submit">Submit</button>
    </form>
  );
};

Other packages similar to @strapi/helper-plugin

FAQs

Package last updated on 03 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc