
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
konvolo-channel-widget
Advanced tools
A React component that embeds a Konvolo Channel in your application.
A React component that embeds a Konvolo Channel in your application.
npm install konvolo-channel-widget
# or
yarn add konvolo-channel-widget
import KonvoloChannel from "konvolo-channel-widget";
function App() {
return <KonvoloChannel cid="your-channel-id" theme="light" />;
}
The KonvoloProvider
provides a more flexible way to manage multiple channels and their states:
import { KonvoloProvider, useKonvolo } from "konvolo-channel-widget";
// Wrap your app with the provider
function App() {
return (
<KonvoloProvider
initialChannels={{
channel1: { cid: "your-channel-id", theme: "light" },
}}
>
<YourApp />
</KonvoloProvider>
);
}
// Use the channels in your components
function YourComponent() {
const { openChannel, closeChannel, addChannel } = useKonvolo();
useEffect(() => {
// Add a channel
addChannel("my-channel", {
cid: "your-channel-id",
theme: "light",
});
}, []);
return (
<button onClick={() => openChannel("my-channel")}>Open Channel</button>
);
}
Prop | Type | Default | Description |
---|---|---|---|
cid | string | required | The channel ID for your Konvolo Channel |
theme | "light" | "dark" | "light" | The theme of the channel |
width | string | "100%" | The width of the channel iframe |
height | string | "100%" | The height of the channel iframe |
style | React.CSSProperties | undefined | Additional CSS styles to apply to the iframe |
small | boolean | false | Whether to display the channel in small mode. Sets to true by default if height is less than 600px |
language | "sv" | "en" | "fi" | "no" | "da" | "de" | "es" | "fr" | "it" | navigator.language | The language of the channel. |
onInterviewCompleted | () => void | undefined | Callback function when the interview is completed |
onInterviewStarted | () => void | undefined | Callback function when the interview is started |
onChannelLoaded | () => void | undefined | Callback function when the channel is loaded |
metadata | Record<string, string> | undefined | Additional metadata to pass to the channel |
email | string | undefined | Pre-fill the email field in the channel |
firstAnswer | string | undefined | Pre-fill the first answer in the channel |
test | boolean | false | If true, responses and insights will no be generated |
showCloseButton | boolean | false | Whether to show the close button in the channel |
showResetButton | boolean | false | Whether to show the reset button in the channel |
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | The child components to render |
initialChannels | Record<string, KonvoloChannelProps> | {} | Initial channels to be managed by the provider |
modalStyle | React.CSSProperties | {} | Additional CSS styles to apply to the modal container |
The useKonvolo
hook provides the following methods:
Method | Parameters | Description |
---|---|---|
openChannel | (id: string) => void | Opens a channel with the specified ID |
closeChannel | (id: string) => void | Closes a channel with the specified ID |
updateChannelProps | (id: string, props: Partial) => void | Updates the props of a channel |
addChannel | (id: string, props: KonvoloChannelProps) => void | Adds a new channel to be managed by the provider |
removeChannel | (id: string) => void | Removes a channel from the provider |
channels | Record<string, ChannelState> | Current state of all channels |
The channel has minimum dimensions to ensure proper display:
The widget requires a modern browser that supports:
The widget uses iframe communication and requires the following permissions for proper functionality:
clipboard-write
: For copying content from the channelmicrophone
: Required if voice features are activated in the channelTo properly integrate the Konvolo Channel widget, you need to configure your Content Security Policy to allow communication with the Konvolo portal. Add the following to your server's response headers:
const cspHeader = `
default-src 'self';
frame-src 'self' https://portal.konvolo.com;
connect-src 'self' https://portal.konvolo.com;
script-src 'self' 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline';
media-src 'self' https://portal.konvolo.com;
`;
response.headers.set("Content-Security-Policy", cspHeader);
Note: The media-src
directive is added to allow microphone access through the iframe.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy...
FAQs
A React component that embeds a Konvolo Channel in your application.
We found that konvolo-channel-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.