📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

strapi-auto-uuid

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-auto-uuid

This is the description of the plugin.

0.0.8
latest
Source
npm
Version published
Weekly downloads
129
4.88%
Maintainers
1
Weekly downloads
 
Created
Source

Tests

Strapi Auto UUID Plugin

The Strapi Auto UUID Plugin is a custom plugin for Strapi that automatically generates a unique UUID for your content.

Installation

To install the Strapi Auto UUID Plugin, simply run one of the following command:

pnpm add strapi-auto-uuid
npm install strapi-auto-uuid
yarn add strapi-auto-uuid

Usage

Once the plugin is installed, you can add a new custom type to your Strapi content types, no configuration needed. The custom type uses the Strapi UID structure, ensuring that each UUID generated is unique.

You can create new records via the Admin panel, API or GraphQL, and the plugin will automatically generate a UUID for each new record created.

Example

Here's an example of how to use the Strapi Auto UUID Plugin:

  • Install the plugin using npm install strapi-auto-uuid
  • Create a new Strapi model with the custom type autoUUID, like this:
module.exports = {
  attributes: {
    title: {
      type: 'string',
      required: true,
    },
    uuid: {
      type: "customField",
      customField: "plugin::field-uuid.uuid"
    },
  },
};
  • When you create a new record in this model via the Strapi API or GraphQL, the plugin will automatically generate a unique UUID for the uuid field.

That's it! With the Strapi Auto UUID Plugin, you can easily add UUIDs to your Strapi content without having to worry about generating them yourself.

Note: If you are currently using the @bn-digital/strapi-plugin-field-uuid plugin, the strapi-auto-uuid plugin can be used as a replacement without requiring any code changes. Simply install strapi-auto-uuid and remove @bn-digital/strapi-plugin-field-uuid. The Strapi Auto UUID Plugin provides the same functionality as the @bn-digital/strapi-plugin-field-uuid plugin, in addition it supports uuid generation automatically via api or graphql and is actively maintained.

License

This plugin is licensed under the MIT License. See the LICENSE file for more information.

FAQs

Package last updated on 23 Jun 2023

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