Rechat SDK
    Preparing search index...

    Class LeadCapture

    Rechat SDK provides functions to easily link your app with the Rechat system for managing customer relationships (CRM).

    sdk.Leads.capture({
    lead_channel: '2c55e69d-adbe-42d9-97a5-bedb43783b80'
    }, {
    first_name: 'John',
    last_name: 'Doe',
    email: 'john-doe@gmail.com',
    phone: '+18189191212',
    })

    Hierarchy

    • SdkBase
      • LeadCapture
    Index

    Constructors

    Accessors

    • get Tracker(): LeadTracker

      Retrieves the lead tracker instance for managing user tracking operations.

      Returns LeadTracker

      The initialized lead tracker object.

    Methods

    • Rechat SDK provides functions to easily link your form with the Rechat system for managing customer relationships (CRM).

      const formElement = document.querySelector('#lead-form')
      const channel = {
      lead_channel: '2c55e69d-adbe-42d9-97a5-bedb43783b80'
      }

      sdk.Leads.form(formElement, channel)

      Furthermore, a collection of events can be passed as a third parameter to the form function.

      sdk.Leads.form(formElement, channel, {
      onError: (e) => {}
      })

      onError triggers when form submission fails.

      sdk.Leads.form(formElement, channel, {
      onSuccess: () => {}
      })

      When the form submission is successfully executed, the onSuccess event is triggered.

      To check if your form is valid before running it, use the validate function. The submit function will not run if the validate form returns false Otherwise, it will run.

      sdk.Leads.form(formElement, channel, {
      validate: (form) => {
      if (!form.name) {
      return false
      }

      return true
      }
      })

      Parameters

      Returns void

    • Collects the provided Metadata fields from the URL

      Returns Partial<ILeadMetaData>

      List of Lead Metadata