Libraries and SDKs

Vue.js

Our Vue.js SDK lets you seamlessly embed insurance in your Vue 3 project.

Installation

Package Manager

npm install @mycoverai/mca-vue-sdk

CDN

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

Usage

Plugin Registration

import { createApp } from 'vue';
import McaSdk from "@mycoverai/mca-vue-sdk";
import App from './App.vue';

const app = createApp(App);
app.use(McaSdk);
app.mount('#app');

Component Usage

<template>
  <McaSdk
    action="purchase"
    pk="MCAPUBK_ENV|your_public_key"
    payment-option="gateway"
    :pid="['<product-id>']"
    :callback="handleSuccess"
    :on-close="handleClose"
  />
</template>

<script setup>
function handleClose(close_url) {
  console.log("SDK closed", close_url);
}

function handleSuccess(success_url, data) {
  console.log("Operation successful", success_url, data);
}
</script>

Component props

The table below contains the available component props and their descriptions.

ParameterTypeRequiredDescription
pkstringYesYour unique Mycover.ai public key.
actionstringYesThe action you want to perform. Options: purchase, managePolicy, renewal, claim.
pidstring | string[]Yes*The product ID or an array of product IDs. Required for purchase and claim actions.
paymentOptionstringYes*How the customer will pay. Options: gateway or wallet. Required for purchase and renewal actions.
referencestringNoA unique payment reference. Required if using the wallet payment option.
callbackfunctionNoA function called upon successful operation (Purchase, Claim, Renewal, etc). Receives success_url (string) and data (object).
onClosefunctionNoA function called when the customer cancels or closes the SDK. Receives close_url (string).
policyIdstringNoThe ID of an existing policy (used for policy management).
claimIdstringNoThe ID of an existing claim (used to resume/track a claim).
Copyright © 2026