Strapi Admin Toolbox (SAT) is a Strapi plugin that provides a set of tools to manage admin users. This plugin helps you generate fake admin users, delete all admin users except one, and restore a specific admin user. It also aims to include a UI for managing your admins, particularly useful if you get locked out.
-
Generate Fake Admin Users: Create a specified number of fake admin users for testing purposes.
-
Delete All Admins Except the First: Retain only the first admin user and delete all others.
-
Delete All Admins Except a Specific Email: Keep one admin user based on their email address and delete the rest.
-
Restore Admin User: Restore a specific admin user by email.
- Install the plugin via npm:
npm install strapi-plugin-strapiadmintoolbox
- Add the plugin configuration to your
config/plugins.js
orconfig/plugins.ts
file:
config/plugins.js|ts
module.exports = {
...rest of your plugins file.
strapiadmintoolbox: {
enabled: true,
config: {
generateFakeAdmins: {
enabled: false,
count: 50,
},
deleteExceptFirst: {
enabled: false,
},
deleteExceptEmail: {
enabled: false,
email: process.env.ADMIN_EMAIL_TO_KEEP || "",
},
restoreAdmin: {
enabled: false,
email: process.env.ADMIN_EMAIL_TO_KEEP || "",
},
},
},
};
- Add the email to keep in your
.env
file:
ADMIN_EMAIL_TO_KEEP=admin@example.com
The plugin's tasks run automatically when you start your Strapi instance based on the configuration settings.
To generate fake admin users, update the plugin configuration to enable this feature and set the desired count:
generateFakeAdmins: {
enabled: true,
count: 50,
},
To keep only the first admin user and delete all others, enable this feature in the configuration:
deleteExceptFirst: {
enabled: true,
},
To retain an admin user by email and delete all others, set the email in the configuration and enable the feature:
deleteExceptEmail: {
enabled: true,
email: process.env.ADMIN_EMAIL_TO_KEEP || "",
},
To restore a specific admin user by email, enable the feature and set the email in the configuration:
restoreAdmin: {
enabled: true,
email: process.env.ADMIN_EMAIL_TO_KEEP || "",
},
This plugin will include a user interface (UI) in future releases, allowing for easier management of admin users, especially useful in scenarios where you may be locked out.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.