0.8.1 • Published 11 months ago

gyg-wc v0.8.1

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

GetYourGuide + Web Component

license npm

 

This is an unofficial GetYourGuide package.

This web-component is a light wrapper around the GetYourGuide widget focusing on progressive enhancement, simple API, and better page performance (ie. lazy loading).

 

Getting started

Installation

$ npm install gyg-wc
# $ pnpm add gyg-wc
# $ yarn add gyg-wc

Usage / Examples

<!-- index.html - using Vite -->
<script>
  // ✅ Remove the need to add `partner-id` attribute to each web component
  globalThis.GYG_PARTNER_ID = import.meta.env.VITE_GYG_PARTNER_ID;
</script>
<script type="module">
  import "gyg-wc";
</script>

Activities

<gyg-wc url="{location_url}?partner_id={partner_id}" size="{num_items}">
  <a href="{location_url}?partner_id={partner_id}"> Things to do in ... </a>
</gyg-wc>

Availability

<gyg-wc url="{tour_url}?partner_id={partner_id}">
  <a href="{tour_url}?partner_id={partner_id}"> Check availability for ... </a>
</gyg-wc>

Location

<gyg-wc url="{location_url}?partner_id={partner_id}">
  <a href="{location_url}?partner_id={partner_id}"> Things to do in ... </a>
</gyg-wc>

Search

<gyg-wc query="{search_term}" partner-id="{partner_id}">
  <a href="{search_url}?partner_id={partner_id}"> Things to do in ... </a>
</gyg-wc>

Tours

<gyg-wc urls="[{tour_url}?partner_id={partner_id},...]">
  <a href="{tour_url}?partner_id={partner_id}"> Things to do in ... </a>
</gyg-wc>

 

Documentation

Refer to the gyg-wc docs page for details and examples.

 

License

ISC

0.3.0

12 months ago

0.2.1

12 months ago

0.1.2

12 months ago

0.2.0

12 months ago

0.1.1

12 months ago

0.8.1

11 months ago

0.8.0

11 months ago

0.7.1

11 months ago

0.4.0

11 months ago

0.6.0

11 months ago

0.1.0

1 year ago

1.0.0

1 year ago