LiveLike

The LiveLike Developer Hub

Welcome to the LiveLike developer hub. You'll find comprehensive guides and documentation to help you start working with LiveLike as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Chat Basics

The <livelike-chat> element will insert a fully-functional chat room anywhere on the page it is placed. It is a block-level element by default and will grow vertically to fit its contents.

The roomid attribute is required and must be a valid room ID. Chat rooms can be created through the API.

For versions older than 1.20.0 the programid attribute is required to load Stickers and Reactions in chat room.

<script>
LiveLike.init({ clientId })
</script>

<livelike-chat roomid="648bb105-bba4-4c3c-8017-e8f390681759"></livelike-chat>

Sizing Chat Elements

A <livelike-chat> element is in block display by default and its height property is not set, so the element will grow to contain all messages sent to the room. The height of a chat room can be set with the height CSS property, which will allow the message list to be scrolled and the composer will stay positioned at the bottom of the chat element.

/* Example: create a full-screen chat */
livelike-chat {
  height: 100vh; /* Full height of viewport */
  width: 100vw; /* Full width of viewport */
}

Customizing Chats

Chats can be customized even further, such as by overriding the empty and loading message list states or configuring message timestamps.

Chat Room Methods

Livelike.createChatRoom

This method creates a new chatRoom with the given Title and Visibility. Both the arguments are optional. Default visibility for the chatroom is "members". It returns a Promise that resolves the chatRoom object containing roomId and title.

LiveLike.createChatRoom({title: "myTitle", visibility: "everyone"})

Livelike.getChatRoom

Returns the chatRoom object using the roomId passed in the arguments. It returns a Promise that resolves the chatRoom object containing roomId and title.

LiveLike.getChatRoom({roomId: "648bb105-bba4-4c3c-8017-e8f390681759"})

Chat Membership Methods

Livelike.getChatRoomMemberships

Returns all the memberships present for the chatRoom. It returns a Promise that resolves to a object having results: an array containing the list of memberships and next: URL to load next set of memberships if present.

LiveLike.getChatRoomMemberships({roomId: "648bb105-bba4-4c3c-8017-e8f390681759"})

Livelike.getProfileChatRoomMemberships

Returns all the memberships present for the Current User. It returns a Promise that resolves to a object having results: an array containing the list of memberships and next: URL to load next set of memberships if present

LiveLike.getProfileChatRoomMemberships()

Livelike.joinChatRoom

Add a membership for the Current User to the ChatRoom supplied in the argument. It returns a Promise that resolves to a object having membership info

LiveLike.joinChatRoom({roomId: "648bb105-bba4-4c3c-8017-e8f390681759"})

Livelike.leaveChatRoom

Removes deleted the membership for the Current User from the ChatRoom supplied in the argument. It returns a Promise that resolves to nothing

LiveLike.leaveChatRoom({roomId: "648bb105-bba4-4c3c-8017-e8f390681759"})

Updated 3 days ago


Chat


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.