Socket
Socket
Sign inDemoInstall

@transferwise/cookie-consent-js

Package Overview
Dependencies
9
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @transferwise/cookie-consent-js

Cookie consent mechanism


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Cookie consent mechanism to be shown to all EU users across transferwise.com

Consumption

This package generates a webjar to be served by our cookie-consent-service.

To include the consent mechanism on your page, simply add a script tag to your page:

<script src="/cookie-consent.js"></script>

For as long as your page is served from transferwise.com you should now see the cookie consent mechanism on your page.

The script itself includes all necessary CSS. One caveat is that the page must provide the TransferWise brand fonts:

font-family: averta, avenir w02, avenir, Helvetica, Arial, sans-serif;

Localisation

The cookie banner will look for the locale to use in the following places, in order:

  1. localeData cookie
  2. window.config.lang
  3. window.navigator.language
  4. Fallback to en

It uses the first 2 characters of the locale string as the language. In most cases, the locale will just be a 2-letter string. If it finds a 5-character language+country string, it will use the first 2 characters of that e.g. es-ES => es.

Development

To setup the development environment, first run yarn start to start the server. This will serve index.html from localhost:5000.

To build the dist and watch the source files for changes, run yarn build:dev.

Deployment

  • Open a PR, bump version in package.json
  • After merging, check out cookie-consent-service and edit gradle.properties to match the new cookie-consent-js version
  • When cookie-consent-service is merged, it will post a docker tag to #conversion-alerts. Deploy with Octopus.

FAQs

Last updated on 28 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc