import{ BoVerseEmbed }from'@boverse/react';functionApp(){return(<BoVerseEmbedworkflowId="your-workflow-id"apiKey="your-api-key"type="workflow"// or "chat"/>);}
Workflow Component
import{ BoVerseWorkflow }from'@boverse/react';functionApp(){return(<BoVerseWorkflowworkflowId="your-workflow-id"apiKey="your-api-key"placeholder="Ask me anything..."buttonText="Run"onResult={(result)=> console.log(result)}/>);}
Chat Component
import{ BoVerseChat }from'@boverse/react';functionApp(){return(<BoVerseChatworkflowId="your-workflow-id"apiKey="your-api-key"title="My AI Assistant"height={500}/>);}
3. Use Hooks (Full Control)
useWorkflow
import{ useWorkflow }from'@boverse/react';functionMyComponent(){const{ execute, result, isLoading, error }=useWorkflow({
workflowId:'your-workflow-id',
apiKey:'your-api-key',});consthandleSubmit=async()=>{const result =awaitexecute('Generate a poem about coding');
console.log(result.final_output);};return(<div><buttononClick={handleSubmit}disabled={isLoading}>{isLoading ?'Running...':'Generate'}</button>{result &&<p>{result.final_output}</p>}{error &&<p>Error: {error.message}</p>}</div>);}
import{ createBoVerseClient }from'@boverse/react';const client =createBoVerseClient({
apiKey:'your-api-key',});// Execute a workflowconst result =await client.executeWorkflow({
workflowId:'your-workflow-id',
query:'Generate a summary',});
console.log(result.final_output);
API Reference
Components
Component
Description
BoVerseEmbed
iframe-based embed (simplest)
BoVerseWorkflow
Workflow input/output UI
BoVerseChat
Chat interface UI
Hooks
Hook
Description
useWorkflow
Execute workflows programmatically
useChat
Manage chat conversations
BoVerseWorkflow Props
Prop
Type
Default
Description
workflowId
string
required
Your workflow ID
apiKey
string
required
Your API key
baseUrl
string
production URL
Custom API URL
placeholder
string
"Enter your input..."
Input placeholder
buttonText
string
"Run Workflow"
Button label
onResult
function
-
Callback on success
onError
function
-
Callback on error
renderResult
function
-
Custom result renderer
BoVerseChat Props
Prop
Type
Default
Description
workflowId
string
required
Your workflow ID
apiKey
string
required
Your API key
title
string
"AI Assistant"
Chat header title
placeholder
string
"Type your message..."
Input placeholder
height
number|string
500
Container height
BoVerseEmbed Props
Prop
Type
Default
Description
workflowId
string
required
Your workflow ID
apiKey
string
required
Your API key
type
'workflow'|'chat'
"workflow"
Embed type
title
string
-
Chat title (for chat type)
width
number|string
"100%"
iframe width
height
number|string
540
iframe height
Integration with Lovable
In your Lovable project, add the package and use any of the components:
// pages/index.tsx in Lovableimport{ BoVerseWorkflow }from'@boverse/react';exportdefaultfunctionHome(){return(<mainclassName="p-8"><h1>My AI App</h1><BoVerseWorkflowworkflowId={process.env.BOVERSE_WORKFLOW_ID}apiKey={process.env.BOVERSE_API_KEY}/></main>);}