The Form widget is available through our CDN as a single JavaScript file or through NPM as a React component package.

  • HTML

  • React

<script type="module">
import Form from 'https://cdn.jsdelivr.net/npm/@chatvolt/embeds@latest/dist/form/index.js';

Form.initStandard({
formId: 'YOUR_FORM_ID',
});

</script>

Attributes / Props

  • HTML

  • React

<script type="module">
import Form from 'https://cdn.jsdelivr.net/npm/@chatvolt/embeds@latest/dist/form/index.js';

Form.initStandard({
formId: 'YOUR_AGENT_ID',

onEnd: function (values) {
console.log('Form submitted with values:', values);
},
})


</script>
formId
string
required

ID of the Agent

onEnd
function

Callback function that is called when the form is submitted. The function receives the form values as an object.

const form = await Form.initBubble({
  agentId: 'YOUR_AGENT_ID',
  onEnd: function (values) {
    console.log('Form submitted with values:', values);
  },
})