ft-next-barriers
v2.6.8
Published
Provides middleware and server-side logic for Barrier Implementation
Downloads
15
Keywords
Readme
Deprecation notice
The next-barriers project is deprecated and all remaining code has been migrated to inside next-product-selector
More information about why.
next-barriers
Provides middleware and server-side logic for Barrier Implementation
Usage
Add as a dependency in any app that requires barriers, then do:
var barriers = require('ft-next-barriers');
app.use(barriers.middleware);
Required Headers
In order to know which barrier to show and to call the Barrier API the following headers are required. These are all set at the CDN level and will need to be spoofed if running locally.
- FT-Barrier-Type Set to a valid barrier type (eg 'TRIAL', 'PREMIUM' or 'CORPORATE');
- FT-Access-Decision Must be 'DENIED' or barrier will not show
- Country-Code Required by the API - set to any valid iso 3char country country-code (eg 'GBR')
- FT-Content-Classification Required by the API, can be any valid content classification (eg 'CONDITIONAL_STANDARD' or 'CONDITIONAL_PREMIUM')
- FT-Session-Token Required by the API - best off set to an empty string. Otherwise needs to be a valid session with a relevant subscription status
- FT-Cookie-AYSC Not yet required