Code Monkey home page Code Monkey logo

strapi-plugin-init-admin-user's Introduction

strapi-plugin-init-admin-user

Creates a strapi admin user on startup. Simplifies working with multiple strapi environments.

Init Admin Example Variables


Latest Changes

February/10/2023: Small adjustments in case INIT_ADMIN is not a string.

January/11/2023: Updated & tested for strapi (v.4.5.5). Added support for NodeJs 18.x.x.

December/11/2022: Allow INIT_ADMIN to be a JSON-String to minimize struggling with multiple environment variables.


Installation

Add strapi-plugin-init-admin-user to your strapi (v4!).

# npm:
npm install strapi-plugin-init-admin-user
# yarn:
yarn add strapi-plugin-init-admin-user

Create these environment variables with your initial values.

INIT_ADMIN_USERNAME=admin
INIT_ADMIN_PASSWORD=admin
INIT_ADMIN_FIRSTNAME=Admin
INIT_ADMIN_LASTNAME=Admin
[email protected]

It is also possible to use INIT_ADMIN as JSON-String instead of the environment variables above.

INIT_ADMIN='{"username": "admin", "password": "admin", "firstname": "Admin", "lastname": "Admin", "email": "[email protected]"}'

If you decide to also use this plugin outside of development-mode you also need to add the following environment variable (or use INIT_ADMIN as JSON-String).

INIT_ADMIN=true

Usage

After installing the plugin and creating your environment variables start your strapi (locally: npm run develop) and watch out for the info-log:

Created admin (E-Mail: [email protected], Password: [INIT_ADMIN_PASSWORD]).

Note: By default the plugin will only create an initial admin-user if there is no existing user in your strapi application!

Success Notification after Admin Creation on Startup

Init Admin Result in Strapi


Support

Leave a 'Thank You' with a โญ๏ธ on Github and have a nice day!


Links

Plugin on Github
Plugin on NPM
Plugin on Strapi Marketplace


License

MIT License - Created by minzig๐Ÿƒ

strapi-plugin-init-admin-user's People

Contributors

minzig avatar nebnes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.