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::repeatable-related-label.uuid"
},
},
};
License
This plugin is licensed under the MIT License. See the LICENSE file for more information.