axitech-widget
v1.18.0
Published
The Axitech Widget is a powerful tool that allows clients to seamlessly integrate insurance claim experiences (such as accidents, thefts, and damages) into their own web applications. This repository provides two methods of using the widget: installation
Downloads
827
Readme
Axitech Widget
The Axitech Widget is a powerful tool that allows clients to seamlessly integrate insurance claim experiences (such as accidents, thefts, and damages) into their own web applications. This repository provides two methods of using the widget: installation via npm and usage through a CDN URL.
Installation
Using npm
To install the Axitech Widget from npm, run the following command in your project directory:
npm install axitech-widget --save
Using CDN
Alternatively, you can include the widget in your HTML file using a CDN URL:
<script src="https://unpkg.com/[email protected]/dist/axitech-widget.umd.js"></script>
Usage
ES Module
If you've installed the widget using npm and are using it as an ES module, you can import and use it in your JavaScript code like this:
import { load } from 'axitech-widget';
load('YOUR_API_KEY', {
type: 'claim',
clientId: 'YOUR_CLIENT_ID',
user: {
id: 'test',
name: 'Test User',
email: '[email protected]',
phone: '+4917123456789',
},
insurance: {
provider: 'Test Insurance Provider',
policyNumber: '123456',
},
contact: {
phone: '0330 058 4077',
email: '[email protected]',
},
onSuccess: console.log,
onError: console.log,
});
UMD (Global) Version
If you're using the UMD version via the CDN, you can load and initialize the widget within a DOMContentLoaded event listener:
<script>
window.addEventListener('DOMContentLoaded', (event) => {
ClaimsWidget.load('YOUR_API_KEY', {
clientId: 'YOUR_CLIENT_ID',
user: {
id: 'test',
name: 'Test User',
email: '[email protected]',
phone: '+4917123456789',
},
insurance: {
provider: 'Test Insurance Provider',
policyNumber: '123456',
},
contact: {
phone: '0330 058 4077',
email: '[email protected]',
},
onSuccess: console.log,
onError: console.log,
});
});
</script>
License
© 2023 Axitech. All rights reserved.