This is a question which I am looking for the answer and also I am trying to find a way for registration wall injection for my blog pages.
You can check third party integrations for the paywall. I don't know how to do it by code.
Thank you for asking.