Skip to content

Pre-chat form

Collect a visitor's name and email before they send their first message. Useful when you don't have a logged-in product, when out-of-hours visitors should leave contact info for follow-up, or when lead capture is part of your funnel.

For logged-in users, prefer Identity verification. It's signed and trustworthy.

Enable it

html
<script>
  window.InviaroSettings = {
    key: 'wt_...',
    origin: 'https://yourdomain.com',
    brand: {
      preChat: {
        requireName: true,
        requireEmail: true
      }
    }
  };
</script>

The composer is hidden behind a name and email form on first open. Submit unlocks the composer.

The form shows:

  • Visible label above each field.
  • Email format validation with a helpful message on typos.
  • Auto-fill suggestions from saved browser profiles.

Persistence

Submitted values persist via localStorage according to your privacy mode. On refresh, the form auto-skips and the composer is open by default.

Privacy modePersistence
'strict'Stored on first message after activation
'balanced', 'fast'Stored immediately on submit
'none'Memory only. Refresh prompts again.

Custom prompt

ts
brand: {
  preChat: {
    requireName: true,
    requireEmail: true,
    prompt: 'Tell us a bit about yourself before we begin.'
  }
}

What the operator sees

  • display_name from the submitted name.
  • email from the submitted email.
  • is_verified is false. Pre-chat input is a label, not authentication. For trustworthy identity, see Identity verification.

Skipping the form for known users

If userName and userEmail are already set in settings, the form auto-skips:

ts
window.InviaroSettings = {
  key: 'wt_...',
  origin: 'https://yourdomain.com',
  userName: 'Amar',
  userEmail: 'amar@example.com',
  brand: {
    preChat: { requireName: true, requireEmail: true }
  }
};

Logout

When the visitor signs out, clear the stored profile so the next user is prompted again:

js
Inviaro('logout');