1.7.1 • Published 9 days ago

@wayke-se/ecom-web v1.7.1

Weekly downloads
-
License
ISC
Repository
-
Last release
9 days ago

Wayke Ecom Web

Repository for Wayke Ecom Web.

Getting started

Using npm

npm install @wayke-se/ecom-web
import WaykeEcomWeb from '@wayke-se/ecom-web';
import '@wayke-se/ecom-web/dist/index.css';

const context = new WaykeEcomWeb({
  id: '36364808-671a-49da-b69a-5e0fc4cfe83e',
  ecomSdkConfig: {
    api: {
      address: 'https://ecom.wayketech.se',
    },
  },
});

constext.start();

Using cdn The associated css is injected into head by default once a new WaykeEcomWeb(...) is called. This can be turned off by adding disablecssinjection to the script tag.

<button id="ecom-button">Start</button>

<script
  type="module"
  src="https://cdn.wayke.se/public-assets/wayke-ecom-web/x.x.x/index.js"
></script>

<script>
  window.addEventListener('DOMContentLoaded', (_) => {
    var context = new WaykeEcomWeb({
      id: '36364808-671a-49da-b69a-5e0fc4cfe83e',
      ecomSdkConfig: {
        api: {
          address: 'https://ecom.wayketech.se',
        },
      },
    });

    document.getElementById('ecom-button').addEventListener('click', () => context.start());
  });
</script>

Full configuration

new WaykeEcomWeb({
  id: '36364808-671a-49da-b69a-5e0fc4cfe83e',
  rootId: 'random-element-id',
  vehicle: {
    title: 'Lorem ipsum',
    shortDescription: 'Lorem ipsum',
    price: 250000,
    imageUrls: ['https://www...', 'https://www...'],
    modelYear: 2013,
    milage: 4900,
    gearBox: 'Automat',
    fuelType: 'Bensin',
  },
  ecomSdkConfig: {
    api: {
      address: 'https://ecom.wayketech.se',
    },
    bankIdThumbprint: '[Dealer Specific BankId Certificate Thumbprint]', // OPTIONAL
  },
  logo: 'https://placehold.jp/180x40.png', // OPTIONAL
  logoX2: 'https://placehold.jp/360x80.png', // OPTIONAL
  onEvent: (view, event, step, data) => // OPTIONAL
    console.log({
      view,
      event,
      step,
      data,
    }),
});

Instance

Instance contains three public methods, .start(), .close() and .destroy().

Required

  • id Id of the vehicle from Wayke
  • ecomSdkConfig.api.address Should be one of the following urls below:
EnvironmentUrl
Testhttps://ecom.wayketech.se
Productionhttps://ecom.wayke.se

Optional

  • rootId Choose the element, id, that WakeEcomWeb should append to, by default it will be appended to the body.
  • vehicle Used to override specific vehicle data properties provided from Wayke.
  • ecomSdkConfig.bankIdThumbprint By default Wayke's BankId certificate is used to verify customer identity. There is an optional configuration property bankIdThumbprint which allows for dealers to use their own BankId certificate. If the certificate's thumbprint is set that certificate will be used instead, given that it is correctly setup in the Dealer back-office.
  • logo Logo to be displayed in the header of the modal.
  • logoX2 Logo to be displayed in the header with higher resolution of the modal.
  • onEvent Attack function to listen for callback. Callback will be called with 3 parameters

onEvent argsuments

ParameterValueOptional
viewEcomViewfalse
eventEcomEventfalse
stepEcomSteptrue
dataanytrue

Above types are located in src/Utils/ecomEvent.ts

CSS specificity

⚠️ We can guarantee to not overwrite any of the host site CSS. But it is possible for the host site to overwrite the styling in Wayke Ecom. Read how to prevent such overwrites below.

All CSS class names are prefixed using the namespace .waykeecom-*. This will prevent this widget to overwrite any CSS applied to the website on which it is implemented on. However, we can not guarantee other CSS files won't overwrite the CSS in Wayke Ecom. This is due to it is impossible to protect against element selectors.

Reset styles and other necessary CSS targeting elements are selected using a nested selector based of the root element (#wayke-ecom) placed inside a :where() to prevent higher specificity than class name selectors.

Avoid using element selectors (div, a, span etc.) in you website's CSS. It is a good practice to only using classes as selectors. If you experience strange styling in the Wayke Ecom widget, this is probably the case.

Custom CSS

If you want to custommize any CSS we recommend you to include a separate CSS with your styling using our selectors namespaced for higher specificity. I.e., .you-company-name .waykeecom-[COMPONENT_NAME] { };.

The easiest way to add a namespace is to wrap the mounting element (#wayke-ecom) with a div having this namespace set following the example below.

<div class="your-company-name">
  <div id="wayke-ecom"></div>
</div>

Important: We can not guarantee our class names will stay the same or behave the same as they do at a specific time. Please understand that you may have to change the CSS continuously if you decide to add custom styling.

Headings

To prevent multiple h1 on your website, Wayke Ecom does not include a h1 as root heading level. Instead the headings starts from h2.

1.7.1-beta.1

9 days ago

1.7.1

9 days ago

1.7.0

15 days ago

1.7.0-beta.8

16 days ago

1.7.0-beta.7

22 days ago

1.6.2

22 days ago

1.7.0-beta.6

27 days ago

1.7.0-beta.5

2 months ago

1.6.1

2 months ago

1.7.0-beta.4

2 months ago

1.7.0-beta.3

3 months ago

1.7.0-beta.1

3 months ago

1.7.0-beta.2

3 months ago

1.6.0

3 months ago

1.6.0-beta.1

3 months ago

1.6.0-beta.2

3 months ago

1.6.0-beta.3

3 months ago

1.5.3-beta.1

3 months ago

1.5.3

3 months ago

1.5.2

3 months ago

1.5.2-beta.1

3 months ago

1.5.1

8 months ago

1.5.0

8 months ago

1.5.1-beta.6

9 months ago

1.5.1-beta.5

9 months ago

1.5.1-beta.3

10 months ago

1.5.1-beta.4

10 months ago

1.4.12

10 months ago

1.5.1-beta.2

11 months ago

1.5.1-beta.1

11 months ago

1.5.0-beta.2

11 months ago

1.5.0-beta.1

11 months ago

1.5.0-beta.4

11 months ago

1.5.0-beta.3

11 months ago

1.5.0-beta.6

11 months ago

1.5.0-beta.5

11 months ago

1.4.11

12 months ago

1.4.9

12 months ago

1.4.10

12 months ago

1.4.8-beta.1

1 year ago

1.4.8

1 year ago

1.4.7-beta.7

1 year ago

1.4.7-beta.5

1 year ago

1.4.7-beta.6

1 year ago

1.4.7-beta.3

1 year ago

1.4.7-beta.4

1 year ago

1.4.7-beta.1

1 year ago

1.4.7-beta.2

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

2 years ago

1.4.5-beta.1

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.1.6-beta.1

2 years ago

1.1.5-beta.1

2 years ago

1.1.4-beta.1

2 years ago

1.4.2

2 years ago

1.2.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.3-beta.1

2 years ago

1.1.2

2 years ago

1.1.2-beta.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3-beta.1

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.8-beta.16

2 years ago

0.0.8-beta.14

2 years ago

0.0.8-beta.15

2 years ago

0.0.8-beta.13

2 years ago

0.0.8-beta.10

2 years ago

0.0.8-beta.11

2 years ago

0.0.8-beta.9

2 years ago

0.0.8-beta.6

2 years ago

0.0.8-beta.5

2 years ago

0.0.8-beta.8

2 years ago

0.0.8-beta.7

2 years ago

0.0.8-beta.2

2 years ago

0.0.7-beta.2

2 years ago

0.0.8-beta.1

2 years ago

0.0.7-beta.3

2 years ago

0.0.8-beta.4

2 years ago

0.0.8-beta.3

2 years ago

0.0.7-beta.1

2 years ago

0.0.5-beta.1

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago