@rechat/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.2.12 • Public • Published

Rechat SDK library allows you to integrate your website or application with Rechat.

[[include:Installation.md]]

Basic Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://unpkg.com/@rechat/sdk@latest/dist/rechat.min.js"></script>
</head>
<body>

  <button id="capture-1">Lead Capture</button>

  <script>
    const sdk = new Rechat.Sdk()
    
    const channel = {
      lead_channel: '2c55e69d-adbe-42d9-97a5-bedb43783b80'
    }

    const input =  {
      first_name: 'John', 
      last_name: 'Doe',
      email: 'john@rechat.com',
      phone: '+18189191212',
    }

    document.getElementById('capture-1').addEventListener('click', () => {
      sdk.Leads.capture(channel, input)
        .then(() => {
          console.log('Done')
        })
        .catch((e) => {
          console.log('Error:', e)
        })
    })
  </script>
</body>
</html>

More Examples

Lead Capture
Lead Form

Readme

Keywords

none

Package Sidebar

Install

npm i @rechat/sdk

Homepage

rechat.com

Weekly Downloads

60

Version

0.2.12

License

ISC

Unpacked Size

10.4 kB

Total Files

10

Last publish

Collaborators

  • raminmsv
  • martianboy