@huddle01/react
Version:
The Huddle01 React SDK offers a comprehensive suite of hooks, methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.
108 lines (104 loc) • 3.12 kB
JavaScript
// src/utils/createGenericContext.tsx
import React from "react";
var createGenericContext = () => {
const genericContext = React.createContext(void 0);
const useGenericContext = () => {
const contextIsDefined = React.useContext(genericContext);
if (!contextIsDefined) {
throw new Error(
"\u274C Huddle01 client must be used within a HuddleClientProvider"
);
}
return contextIsDefined;
};
return [useGenericContext, genericContext.Provider];
};
// package.json
var package_default = {
name: "@huddle01/react",
version: "2.6.4",
description: "The Huddle01 React SDK offers a comprehensive suite of hooks, methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.",
type: "module",
main: "dist/index.js",
types: "dist/index.d.ts",
exports: {
".": {
import: "./dist/index.js",
types: "./dist/index.d.ts"
},
"./hooks": {
import: "./dist/hooks/index.js",
types: "./dist/hooks/index.d.ts"
},
"./components": {
import: "./dist/components/index.js",
types: "./dist/components/index.d.ts"
}
},
scripts: {
build: "tsup",
watch: "tsup --watch",
pub: "bun run build && npm publish --access public --loglevel=silly",
"pub:dev": "bun run build && npm publish --access public --tag dev",
"pub:alpha": "bun run build && npm publish --access public --tag alpha",
"pub:beta": "bun run build && npm publish --access public --tag beta"
},
tsup: {
entry: ["src/**/*.ts"],
sourcemap: true,
dts: true,
splitting: true,
clean: true,
format: ["cjs", "esm"]
},
files: ["dist/*", "index.d.ts", "hooks.d.ts", "components.d.ts"],
keywords: ["huddle01", "react", "RTC", "web3"],
contributors: [
"Om Gupta <omgupta0720@gmail.com>",
"Arush Kurundodi <arushkurundodi@gmail.com>",
"Mizan Ali <mizanalip786@gmail.com>",
"Akshit Gupta <A4748g@gmail.com>",
"Deepanshu Singh",
"Akash Mondal <akmo3901@gmail.com>"
],
author: "OmGuptaIND",
license: "ISC",
devDependencies: {
"@types/react": "^19.1.0",
tsconfig: "workspace:*",
tsup: "^8.4.0",
types: "workspace:*",
typescript: "5.6.2",
"vite-tsconfig-paths": "^5.1.4"
},
dependencies: {
"@huddle01/web-core": "2.6.4",
"@tanstack/react-query": "^5.72.0",
"@testing-library/react": "^16.3.0",
"@testing-library/react-hooks": "^8.0.1",
axios: "^1.8.4"
},
peerDependencies: {
react: "19.0.0"
}
};
// src/HuddleContext.tsx
import { jsx } from "react/jsx-runtime";
var [useHuddle01, HuddleContextProvider] = createGenericContext();
var HuddleProvider = ({ children, client }) => {
client.socket.__platform = `react@${package_default.version}`;
return /* @__PURE__ */ jsx(
HuddleContextProvider,
{
value: { huddleClient: client, version: package_default.version },
children
}
);
};
// src/hooks/useHuddle01.ts
var useHuddle01_default = useHuddle01;
export {
HuddleProvider,
useHuddle01_default
};
//# sourceMappingURL=chunk-EWIULLG2.js.map