npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mycoverai/mca-javascript-sdk

v0.9.0

Published

Supercharge your business with embedded insurance

Downloads

141

Readme

MyCover.ai Javascript SDK

Official MyCover.ai SDK. Supercharge your product with MyCover AI Insurance offerings. Create embedded insurance offerings or full white label insurance applications that excite your customers.

Installation

With NPM

npm install @mycoverai/mca-javascript-sdk@latest

From CDN

<script src="https://unpkg.com/@mycoverai/mca-javascript-sdk/dist/index.js"></script>

Usage

With NPM

//import package
import mycoverai from "@mycoverai/mca-javascript-sdk";

//setup your business configuration by supplying your public key. If pid is not provided or is an empty array, the SDK will display a list of insurance products for the customer to choose from. You can supply an array of strings, where each string represents an insurance product id, for the user to select from.
const config = {
  pid: ["a72c4e3c-e868-4782-bb35-df6e3344ae6c"], //optional
  pk: "MCAPUBK_TEST|d24a7f02-99c8-497f-b1cc-d6d14d7963d5",
  form: {} /*** Provide form data that your user has already given to ease form filling. The form object and all it's properties are optional, you only need to provide this when they are available. However, the property names must match the following format
   form: {
   "state": "lagos",
   "first_name": "micheal",
   "last_name": "okafor",
   "bvn": "22226850607",
   "address": "Plot 8, Providence Street, Lekki Phase 1, Lagos, Nigeria",
   "email": "[email protected]",
   "date_of_birth": "2015-05-19",
   "phone_number": "08011111111",
  }
   Where the property names do not match the ones we have provided above, such fields will be discarded and ignored.
 ***/,
  payment_option: "gateway", //set to 'wallet' or 'gateway' to define default payment option
  callback: Function, //A function you want us to call after the user has completed
  onClose: Function, //A function you want us to call after the user closes without completing a purchase, activation or inspection
  reference: "", //optional. supply reference when you want the user to continue to the insurance activation step. This only applies to users who have previously bought insurance using this SDK,
  action: "purchase",
};

//create a function that starts up the SDK
function buyInsurance() {
  mycoverai(config);
}

With CDN

<button onclick="buyInsurance">Buy Insurance</button>

<script src="https://unpkg.com/@mycoverai/mca-javascript-sdk/dist/index.js"></script>
<script>
  const config = {
    pid: ["a72c4e3c-e868-4782-bb35-df6e3344ae6c"], //optional
    pk: "MCAPUBK_TEST|d24a7f02-99c8-497f-b1cc-d6d14d7963d5",
    form: {} /*** Provide form date that your user has already given to ease form filling. The form object and all it's properties are optional, you only need to provide this when they are available. However, the property names must match the following format
     form: {
   "state": "Nasarawa",
   "first_name": "Lucian",
   "last_name": "Bryant",
   "bvn": "22226850607",
   "address": "Rem quae molestias h",
   "email": "[email protected]",
   "date_of_birth": "2015-05-19",
   "phone_number": "+2348011111111",
  }
     Where the property names do not match the ones we have provided above, such fields will be discarded and ignored.
     ***/,
    payment_option: "gateway", //set to 'wallet' or 'gateway' to define default payment option
    callback: Function, //A function you want us to call after the user has completed
    onClose: Function, //A function you want us to call after the user closes without completing a purchase, activation or inspection
    reference: "", //optional. supply reference when you want the user to continue to the insurance activation step. This only applies to users who have previously bought insurance using this SDK,
    action: "purchase",
  };

  function buyInsurance() {
    mycoverai(config);
  }
</script>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT