# paywall.json

paywall.json is Marfeel extension point to add a paywall to a site. It follows Marfeel's extensibility philosophy and can be used to configure any Marfeel-compatible paywall provider.

# Set up and configuration

To activate any paywall provider for a tenant, create a paywall.json file inside the tenant's resources folder that follows this structure:

{
    "type": "c",
    "config":{
        "script": "example.js",
        "id": "1234"
    },
	"options": {}
}
  • type: name of the provider
  • config: object with as many parameters as needed in order to properly configure and initialize the provider (ex. id, script, etc.).
  • options: an object with Marfeel-specific configuration, such as hideAds or hideArticles.

The paywall provider package must also be installed in the tenant's dependencies in the package.json.

TIP

Remember to commit the package-lock.json changes as well.

# Debug in local

Use npm link to debug a paywall provider in local environment:


 




 






$ paywall-providers/packages/newProvider
$ npm link
...
/Users/user/.nvm/versions/node/v12.16.0/lib/node_modules/@marfeel/paywall-providers-newProvider -> /Users/user/Marfeel/paywall-providers/packages/newProvider

$ cd ~/Marfeel/ProTenants/Mediagroup
$ npm link @marfeel/paywall-providers-newProvider
/Users/user/Marfeel/ProTenants/Mediagroup/node_modules/@marfeel/paywall-providers-newProvider -> /Users/user/.nvm/versions/node/v12.16.0/lib/node_modules/@marfeel/paywall-providers-newProvider -> /Users/user/Marfeel/paywall-providers/packages/newProvider

...
$ npm run build
...