@nyris/nyris-widget

0.3.78 • Public • Published

nyris-widget

Embed the widget to use nyris search on your website.

Usage

Inside your HTML (best just before the closing </body> tag), add the following code to embed the Nyris widget script and configure widget settings:

<script>
    window.nyrisSettings = {
        apiKey: '', // nyris API key
        initiatorElementId: ['id-1','id-2'], // IDs of HTML elements that trigger the widget; array with a single ID or multiple IDs
        primaryColor: '#3E36DC', // Color for the logo and buttons (other than camera  and browse gallery buttons)
        cameraIconColour: '#2B2C46', // Color for camera button
        browseGalleryButtonColor: '#E4E3FF', // Color of 'Browse Gallery' button in mobile view
        customerLogo: '', // URL to display customer logo
        logoWidth: 256, // Width for customer logo in pixels, works only with customerLogo
        ctaButtonText: 'View more', // Button text on result card linking to product details web page
        language: 'en', // Widget display language
        navigatePreference: '_blank' // Routing behaviour of the CTA button, open in current/new tab
        cadenasAPIKey: '', // API key provided by cadenas
        cadenasCatalog: '', // Catalog ID provided by Cadenas
        feedback: false , // Enables feedback; Always a boolean value   
        searchCriteriaLabel: 'Select a machine', // Define the text for search criteria pop-up
        searchCriteriaKey: '', // Define the attribute where filter values are stored
        filter: [] // Define attributes and labels for search Refinements e.g. [{label: 'Brand', field: 'brand' }]
    };
    var s = document.createElement("script");
    s.src = "https://assets.nyris.io/nyris-widget/v1/widget.js";
    document.getElementsByTagName('head')[0].appendChild(s);
</script>

Building a custom version

Follow the steps on main README initialize all packages. Then in this directory, run npm start for a local development server or npm run build to build a minified widget.js.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.7849latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.7849
0.3.7754
0.3.764
0.3.751
0.3.742
0.3.730
0.3.721
0.3.711
0.3.701
0.3.690
0.3.680
0.3.670
0.3.660
0.3.651
0.3.641
0.3.630
0.3.620
0.3.611
0.3.600
0.3.590
0.3.581
0.3.570
0.3.560
0.3.550
0.3.540
0.3.530
0.3.521
0.3.510
0.3.500
0.3.490
0.3.481
0.3.471
0.3.460
0.3.450
0.3.441
0.3.430
0.3.420
0.3.410
0.3.400
0.3.391
0.3.381
0.3.370
0.3.361
0.3.351
0.3.340
0.3.330
0.3.320
0.3.312
0.3.300
0.3.290
0.3.270
0.3.260
0.3.251
0.3.240
0.3.230
0.3.220
0.3.210
0.3.200
0.3.191
0.3.180
0.3.170
0.3.160
0.3.150
0.3.140
0.3.132
0.3.122
0.3.90
0.3.60
0.3.51
0.3.40
0.3.30
0.3.20
0.3.10
0.2.60
0.2.51
0.2.41
0.2.31
0.2.21
0.2.10
0.2.00
0.1.90
0.1.80
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.01

Package Sidebar

Install

npm i @nyris/nyris-widget

Weekly Downloads

135

Version

0.3.78

License

none

Unpacked Size

16.6 MB

Total Files

94

Last publish

Collaborators

  • nyris-hfries
  • f.medini
  • nyris-itops