Skip to content

Quickstart

Get a working chat widget on your site in about five minutes.

1. Grab your app key

Sign in to the Lane.Chat dashboard, open your application, and copy its app key (app_pub). It looks like app_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d (app_ followed by 32 hex characters). This value is public — it is meant to ship in browser code.

2. Add the script tag

Paste this just before the closing </body> tag on every page where you want the widget:

html
<script
  src="https://cdn.lane.chat/js/widget.js"
  data-app-key="YOUR_APP_KEY"
></script>

That is it. The widget auto-initializes on page load, mounts a floating launcher in the corner, and opens a visitor session the first time the panel is opened.

3. Open the chat from your own button (optional)

The widget exposes a global API object under window.laneChat. Wire it to any element:

html
<button id="support">Chat with us</button>

<script>
  document.getElementById('support').addEventListener('click', () => {
    window.laneChat.open()
  })
</script>

4. Tell Lane.Chat who the visitor is (optional)

Once a user is logged in, push their identity. Standard fields (email, name, phone) are promoted onto the visitor profile; anything else shows up as a custom attribute in the agent panel.

js
window.laneChat.identify({
  email: '[email protected]',
  name: 'Jane Doe',
  plan: 'pro',
  seats: 12,
})

identify() is safe to call before or after the widget mounts — early calls are buffered and applied on init.

5. React to open/close (optional)

js
const off = window.laneChat.on('open', () => {
  console.log('Support panel opened')
})
// call off() to unsubscribe

Next steps

Lane.Chat — AI customer support, multichannel CRM, and roleplay AI.