const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: {
enableBadWordsFilter: true,
enableWebSearch: true,
enableHistory: true,
enableVoice: true,
enableFollowUps: true,
enableComponentCreation: true,
placeholderText: '<string>',
enableWebSearchSources: true,
enableImageSources: true,
enableTranscript: true,
enableOutline: true,
enableGuardrails: true,
enablePromptingScore: true,
enableResponsibilityScore: true,
enableReferenceMode: true
},
width: '<string>',
height: '<string>',
expiryHours: 1
})
};
fetch('https://studyfetchapi.com/api/v1/components/{id}/embed', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));