@hoosei/voxweave-react
Version:
A customizable and interactive voice UI component for React applications
35 lines (34 loc) • 858 B
JavaScript
import { useEffect as n, createContext as i, useContext as a } from "react";
import { configureVoxweave as t } from "./index5.js";
import { jsx as s } from "react/jsx-runtime";
const r = i(null);
function x() {
const o = a(r);
if (o === null)
throw new Error("useVoxweave must be used within a VoxweaveProvider");
return o;
}
function c({
children: o,
config: e
}) {
return n(() => {
(async () => {
typeof window < "u" && (e.development ? await t({
licenseKey: "vox_admin_development_override",
apiUrl: e.apiUrl || "http://localhost:4200/api"
}) : await t({
licenseKey: e.licenseKey,
apiUrl: e.apiUrl
}));
})();
}, [e]), /* @__PURE__ */ s(r.Provider, {
value: e,
children: o
});
}
export {
c as VoxweaveProvider,
x as useVoxweave
};
//# sourceMappingURL=index3.js.map