You need to wait for 3.10.X to become available; as per the documentation, "This guide assumes you are starting on Joomla 3.10.x. If you are on a earlier version make sure you upgrade to Joomla 3.10 first before moving to Joomla 4."
Joomla 3.10 is currently in development, at 86% completion, most notably, with no completion date for release. V3.10-...
This should still work in 4.0 but will break in 5.0. You are advised to use fully qualified class names. Remove JLoader::register() call and instead add a use statement:
You are using onAfterRender event which is not suitable for modifying the document object because this event is triggered after the page has already been rendered. Use onAfterDispatch, onBeforeRender or onBeforeCompileHead instead.
$document->addScriptDeclaration() method is working, no problem with that.
window.event is deprecated:
instead of that you should use document.addEventListener() or window.addEventListener() on the event of DOMContentLoaded
If you want to translate the variables, you need to do it before passing them to Text::sprintf():
This hasn't changed since J3 and Joomla\CMS\Language\Text::sprintf() is not deprecated in J4.
The Joomla 4 workflow allows you to replace the static states (unpublished, published, trashed and archived) with your own custom solution. When you assign a workflow to a category of articles, this would apply both to new and existing content. That said, you may have issues if the state of the existing article does not exist in the new workflow applied to ...
In the Joomla Extension Directory there is a free OTP plugin for Joomla available that uses an external commercial SMS (Text message) provider:
OTP Verification For Joomla
Maybe you can use the plugin + its SMS provider as solution, or use the code to develop your own Firebase OTP plugin?
Just an FYI that Joomla 3.10-alpha has now been released so the upgrade process can now easily done.
Go to the Joomla Update Component Options and switch the Update Channel to Testing and the Minimum Stability option to Alpha.
Update to 3.10 alpha1 using the Joomla Update Component.
After you have updated to 3.10 alpha please switch the Update