const url = 'https://studyfetchapi.com/api/v1/components/{id}/embed';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: '{"userId":"<string>","groupIds":["class-101","class-102"],"sessionId":"<string>","theme":{"primaryColor":"<string>","secondaryColor":"<string>","backgroundColor":"<string>","textColor":"<string>","fontFamily":"<string>","fontSize":"<string>","borderRadius":"<string>","padding":"<string>","logoUrl":"<string>","hideBranding":true},"features":{"enableWebSearch":true,"enableHistory":true,"enableVoice":true,"enableFollowUps":true,"enableComponentCreation":true,"placeholderText":"<string>","enableWebSearchSources":true,"enableImageSources":true,"enableTranscript":true,"enableOutline":true,"enableBadWordsFilter":true,"enableGuardrails":true,"enablePromptingScore":true,"enableResponsibilityScore":true,"enableReferenceMode":true},"width":"<string>","height":"<string>","expiryHours":1}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}