<h1 align="center">
  <img src="https://img.ideal-postcodes.co.uk/Shopwired%20Integration%20Logo%403x.png" alt="Ideal Postcodes ShopWired Integration">
</h1>

> Add UK address search and validation to ShopWired address forms

![CI](https://github.com/ideal-postcodes/atlas/workflows/CI/badge.svg?branch=main)
[![npm version](https://badge.fury.io/js/%40ideal-postcodes%2Fshopwired.svg)](https://badge.fury.io/js/%40ideal-postcodes%2Fshopwired)

`@ideal-postcodes/shopwired` builds the integration code to enable UK address search and validation on ShopWired address forms.

For installation, feature list and configuration see our [guide](https://ideal-postcodes.co.uk/guides/shopwired).

This integration injects address validation scripts at the site of ShopWired's custom checkout javascript.

ShopWired introduced a breaking change? Contact [support](https://ideal-postcodes.co.uk/support).

## Links

- [Guide](https://ideal-postcodes.co.uk/guides/shopwired)
- [Changelog](./CHANGELOG.md)
- [Support](https://ideal-postcodes.co.uk)
- [npm Module](https://www.npmjs.com/package/@ideal-postcodes/shopwired)
- [CDN](https://www.jsdelivr.com/package/npm/@ideal-postcodes/shopwired)

## Configuration Options

Upon loading, the script will exit unless a global configuration object (`idpcConfig`) is detected.

```javascript
<script type="text/javascript">
  window.idpcConfig = {
    apiKey: "ak_test",
  };
<script>
```

A list of configuration options can be found in our [guide](https://ideal-postcodes.co.uk/guides/shopwired).

## Screenshots

Address autocompletion

![Address Autocomplete](https://img.ideal-postcodes.co.uk/shopwired-autocomplete.png)

## License

SEE LICENSE IN LICENSE
