@carforyou/whitelabel-widget

1.4.80 • Public • Published

CAR FOR YOU Whitelabel widget

semantic-release

Usage

This package provides:

  • bundled version of whitelabel preact app for production and preprod environments
  • a generator for the code snippet that needs to be included

If you want to display the snippet on your page you can:

import { whitelabelSnippet } from "@carforyou/whitelabel-widget"

This function takes following parameters:

  • association
  • dealerId
  • language
  • widgetUrl and generates a snippet that needs to be put on widget consumer's page

The widget itself is deployed to a S3 bucket and served from there.

Note: If both dealer and association are passed, and the dealer is part of the association, it's preselected and already filtered by that dealer (if not, the result is empty.

Development

Between assets, translations, legacyIdMapping (needed to support old whitelabel integration) there's quite a bunch of generated code that's needed for the preact app to run. Make sure to:

npm run build:generated

to ensure that all required files are built.

From then on you can:

npm run dev

to start a dev server.

You can pass dealerId, association (either one or both) and locale properties via .env parameters.

Release a new version

New versions are released on the ci using semantic-release as soon as you merge into master. Please make sure your merge commit message adheres to the corresponding conventions.

Deployments to s3

There following S3 buckets are available:

carforyou-dev-whitelabel-widget:

carforyou-preprod-whitelabel-widget:

carforyou-prod-whitelabel-widget:

On merge to master bundled javascript is written to prod and preprod buckets. Dev bucket is written to from every PR, with a file containing branch name. This allows testing branches.

Readme

Keywords

none

Package Sidebar

Install

npm i @carforyou/whitelabel-widget

Weekly Downloads

1

Version

1.4.80

License

MIT

Unpacked Size

858 kB

Total Files

101

Last publish

Collaborators

  • carforyou-engineering
  • lkappeler