UNPKG

@hoosei/voxweave-react

Version:

A customizable and interactive voice UI component for React applications

3 lines (2 loc) 936 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index5.js"),a=/^vox_dev_[a-zA-Z0-9]{30}$/;let r=s=>!1;async function c(s){try{const{licenseKey:t}=n.getConfig(),e=s||t;if(!e)return console.error("No license key provided"),!1;if(r(e),e.startsWith("vox_dev_")){if(!a.test(e))return console.error("Invalid development license key format"),!1;const i=await(await fetch(`${n.getConfig().apiUrl}/v1/license/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:e})})).json();return i.success&&i.data?.valid}const o=await(await fetch(`${n.getConfig().apiUrl}/v1/license/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:e})})).json();return o.success&&o.data?.valid}catch(t){return console.error("Voxweave license error:",t),!1}}exports.validateLicenseKey=c; //# sourceMappingURL=index14.js.map