npm i strapi-plugin-paywall
Open plugins's settings and add rules for content types.
Set permissions for public role. Open the public role. Then click "paywall". Turn on "getcontent", "visit" and "setvisitorid" checkboxes.
<script src="${strapi.backendURL}/paywall.js"></script>
<div data-paywall="true">...</div>
window.paywallId.then(async (id) => {
if (id) {
this.article.<field-trimmed-by-paywall> = await this.$strapi.$http.$get(\`/paywall/content/<modelName>/$\{this.$route.params.id}/$\{id}\`)
}
});