Automatically generate a NanoID for your components
The Strapi Auto NanoID Plugin is a custom plugin for Strapi that automatically generates a unique NanoID for your content.
To install the Strapi Auto NanoID Plugin, simply run one of the following command:
1pnpm add strapi-auto-nanoid
1npm install strapi-auto-nanoid
1yarn add strapi-auto-nanoid
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 NanoID generated is unique.
You can create new records via the Admin panel, API or GraphQL, and the plugin will automatically generate a NanoID for each new record created.
Here's an example of how to use the Strapi Auto NanoID Plugin:
npm install strapi-auto-nanoid
autoNanoID
, like this:1module.exports = {
2 attributes: {
3 title: {
4 type: 'string',
5 required: true,
6 },
7 uid: {
8 type: "customField",
9 customField: "plugin::field-nanoid.nanoid"
10 },
11 },
12};
uid
field.That's it! With the Strapi Auto NanoID Plugin, you can easily add NanoID to your Strapi content without having to worry about generating them yourself.
This plugin is licensed under the MIT License. See the LICENSE file for more information.
This plugin is a fork of strapi-auto-uuid
based on the work by Cringe Studio: https://github.com/Cringe-Studio/strapi-auto-uuid
npm install strapi-auto-nanoid
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.