How-to add Script Editor app to your SharePoint modern site

Before you can add a scrip editor app to your SharePoint modern site, as an administrator you must enable [Allow Custom Scripts] on that modern site.

To do that you will need access to SharePoint Online Management Shell, so you will need tenant admin permissions:

  1. Open [SharePoint Online Management Shell] as administrator

  2. Execute and enter your username and password to authenticate as admin:
    Connect-SPOService -Url 'https://[tenant-name]'

  3. Execute:
    Set-SPOsite https://[tenant-name][site_name] -DenyAddAndCustomizePages 0

Above replace the [tenant-name] with the URL of your tenant.
Replace the [site_name] with the Url of the site where you need the Script Editor enabled.

If you have more than one site where you want the Script Editor to work, you will need to execute #3 for each of those sites.