Skip to main content

Basic usage

ReactJs

In order to integrate Retorik Framework in an existing ReactJs application, you need to import the wanted component (RetorikAgent, RetorikWidget or RetorikNews), and then to use it as any ReactJs component by assigning the necessary props

Javacript

In order to integrate Retorik Framework with a javascript script, you need to :

  • have the package imported from the CDN ((see import from CDN))
  • have an element as container inside the DOM. For example an element as <div id="#my-retorik-agent" />
  • call the right method to render the wanted component :
    • window.Retorik.renderAgent(props, element);
    • window.Retorik.renderWidget(props, element);

Configuration

Here are the links to follow to get more informations about configuration :

  • minimum configuration here
  • every configuration option available, here

Examples

Retorik Agent
import React from 'react';
import { RetorikAgent } from '@davi-ai/retorik-framework';
import * as props from './config';

const App = () => {
return <RetorikAgent {...props} />;
};

export default App;
Retorik Widget
import React from 'react';
import { RetorikWidget } from '@davi-ai/retorik-framework';
import * as props from './config';

const App = () => {
return <RetorikWidget {...props} />;
};

export default App;
Retorik News
import React from 'react';
import { RetorikNews } from '@davi-ai/retorik-framework';
import * as props from './config';

const App = () => {
return <RetorikNews {...props} />;
};

export default App;