@hoosei/voxweave-react
Version:
A customizable and interactive voice UI component for React applications
43 lines (42 loc) • 1.14 kB
JavaScript
import { getConfig as t } from "./index5.js";
const r = /^vox_dev_[a-zA-Z0-9]{30}$/;
let i = (n) => !1;
async function f(n) {
try {
const {
licenseKey: s
} = t(), e = n || s;
if (!e)
return console.error("No license key provided"), !1;
if (i(e), e.startsWith("vox_dev_")) {
if (!r.test(e))
return console.error("Invalid development license key format"), !1;
const a = await (await fetch(`${t().apiUrl}/v1/license/validate`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
licenseKey: e
})
})).json();
return a.success && a.data?.valid;
}
const o = await (await fetch(`${t().apiUrl}/v1/license/validate`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
licenseKey: e
})
})).json();
return o.success && o.data?.valid;
} catch (s) {
return console.error("Voxweave license error:", s), !1;
}
}
export {
f as validateLicenseKey
};
//# sourceMappingURL=index14.js.map