Overview
The Explainers component creates engaging video explanations that combine visual elements like diagrams, animations, and charts with AI narration. Perfect for complex topics that benefit from visual learning.
Creating an Explainers Component
import StudyfetchSDK from '@studyfetch/sdk' ;
const client = new StudyfetchSDK ({
apiKey: 'your-api-key' ,
baseURL: 'https://studyfetchapi.com' ,
});
const explainerComponent = await client . v1 . components . create ({
name: 'Cell Biology Explainer' ,
type: 'explainers' ,
config: {
materials: [ 'mat-123' , 'mat-456' ],
folders: [ 'folder-789' ],
title: 'Understanding Cell Structure and Function' ,
style: 'educational' ,
targetLength: 300 ,
model: 'gpt-4o-mini-2024-07-18' ,
imageSearch: true ,
webSearch: true ,
verticalVideo: false
}
});
console . log ( 'Explainer component created:' , explainerComponent . _id );
Configuration Parameters
Name of the explainers component
Explainers configuration object Show Configuration Properties
Array of material IDs for visual explanation context
Array of folder IDs containing materials
Title of the explainer video
style
string
default: "educational"
Visual style of the explainer:
professional
- Clean, corporate style
casual
- Relaxed, conversational approach
educational
- Traditional teaching style
animated
- Fun, cartoon-style animations
Target video length in seconds:
120
- 2 minutes (quick overview)
300
- 5 minutes (standard)
600
- 10 minutes (detailed)
900
- 15 minutes (comprehensive)
1200
- 20 minutes (in-depth)
model
string
default: "gpt-4o-mini-2024-07-18"
AI model to use for generating the explainer content
Enable searching for relevant images to include in the explainer
Enable web search for additional information and context
Create video in vertical format (9:16) for mobile viewing
Response
{
"_id" : "comp_303pqr" ,
"name" : "Cell Biology Explainer" ,
"type" : "explainers" ,
"status" : "processing" ,
"config" : {
"materials" : [ "mat-123" , "mat-456" ],
"folders" : [ "folder-789" ],
"title" : "Understanding Cell Structure and Function" ,
"style" : "educational" ,
"targetLength" : 300 ,
"model" : "gpt-4o-mini-2024-07-18" ,
"imageSearch" : true ,
"webSearch" : true ,
"verticalVideo" : false
},
"createdAt" : "2024-01-15T10:00:00Z" ,
"updatedAt" : "2024-01-15T10:00:00Z" ,
"organizationId" : "org_456def" ,
"video" : {
"url" : null ,
"thumbnailUrl" : null ,
"duration" : null
}
}
Embedding This Component
Once you’ve created an Explainers component, you can embed it on your website using the embedding API.
Generate Embed URL
const embedResponse = await client . v1 . components . generateEmbed ( explainerComponent . _id , {
// User tracking
userId: 'user-456' ,
studentName: 'Jane Smith' , // Student name for display
groupIds: [ 'class-101' , 'class-102' ],
sessionId: 'session-789' ,
// Explainer-specific features
features: {
enableWebSearchSources: true ,
enableImageSources: true ,
enableTranscript: true ,
enableOutline: true
},
// Dimensions
width: '100%' ,
height: '600px' ,
// Token expiry
expiryHours: 24
});
Explainer-Specific Embedding Features
features.enableWebSearchSources
Display web search sources used in the explanation
features.enableImageSources
Display sources for images and diagrams used in the video
features.enableTranscript
Display synchronized subtitles/transcript below the video player
Show video chapters and topic outline for easy navigation
Embed in Your HTML
< iframe
src = "https://embed.studyfetch.com/component/comp_303pqr?token=..."
width = "100%"
height = "600px"
frameborder = "0"
allowfullscreen
style = "border: 1px solid #e5e5e5; border-radius: 8px;" >
</ iframe >