Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/psammead-amp-geo

Package Overview
Dependencies
Maintainers
38
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/psammead-amp-geo

React component for AMP Geo

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
38
Weekly downloads
 
Created
Source

psammead-amp-geo - Known Vulnerabilities Storybook GitHub license npm version PRs Welcome

Description

The psammead-amp-geo component is an <amp-geo> element to be used for AMP pages. It has a defined set of ISO country groups that we set for our privacy and cookie banners on AMP pages.

Installation

npm install @bbc/psammead-amp-geo

Props

ArgumentTypeRequiredDefaultExample
No props.

Usage

When using psammead-amp-geo, you should firstly include this script in the head of the page:

<script
  async
  custom-element="amp-geo"
  src="https://cdn.ampproject.org/v0/amp-geo-0.1.js"
/>

Then you can import the AmpGeo component & use it in conjunction with <amp-consent>

import AmpGeo from '@bbc/psammead-amp-geo';

const Wrapper = () => (
  <>
    <AmpGeo />
      <amp-consent id="uniqueId" layout="nodisplay">
      <script
        type="application/json"
        >
        {
        consents: {
          'user-consent': {
            promptIfUnknownForGeoGroup: 'eea',
            promptUI: 'promptId',
          },
        },
      }
      </script>
      </amp-consent>
  </>
);

When to use this component

Use this component only on AMP pages when you need to have geo-location constrained to a specific list of countries in the EEA, also including Channel Islands and overseas territories.

Accessibility notes

The psammead-amp-geo is an <amp-geo> element.

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

Keywords

FAQs

Package last updated on 08 Aug 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc