@bryanfox/personalized-banners-client-script
v1.2.0
Published
Fox Dealer Personalized Banner Client Script
Downloads
107
Readme
README
Code is available to be served from CDN: https://www.npmjs.com/package/@bryanfox/personalized-banners-client-script
For Development, commit any changes locally and then run:
npm version <major-version>-dev.<dev-version>
npm publish --access=public --tag devVersions can be found here: https://www.npmjs.com/package/@bryanfox/personalized-banners-client-script?activeTab=versions
This create a new version with a dev tag and version on the CDN and won't affect the latest production code
The dev code will then be available at the new dev version: https://cdn.jsdelivr.net/npm/@bryanfox/personalized-banners-client-script@<major-version>-dev.<dev-version>/index.js
For Production, run:
npm version <next-major-version>
Make a new PR for these changes before publishing the new code to the CDN.
Once the new code is in master branch pull from the master branch we need to create a new minified file and publish it to npm.
Make sure Uglify is installed locally: https://www.npmjs.com/package/uglify-js.
uglifyjs -c drop_console -m -o index.min.js index.js
npm publish --access=publicThe new production code will then be available under the latest version: https://cdn.jsdelivr.net/npm/@bryanfox/personalized-banners-client-script@latest/index.min.js
Example Usage:
const script = document.createElement('script');
script.setAttribute('src', 'https://cdn.jsdelivr.net/npm/@bryanfox/personalized-banners-client-script@latest/index.min.js');
script.setAttribute('async', true);
document.body.appendChild(script);
script.onload = () => {
const fdiPB = new fdiPersonalizedBanners({ make: [], model: ['Camry'], standardBody: [], condition: [], is_service_page: false });
fdiPB.onDelivery(function(personalizedBanners) {
... process personalized banners ...
});
}