Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kuechenplaner's avatar

Prebuild user chat integration recommendation?

Hello,

I have a laravel 11 application with vue + inertia.js stack. Now I need a one to one user chat. I've tried chatify but there are some bugs with the newest laravel version. I need a fast way to integrate a chat and i don't want to write all myself with laravel reverb or pusher.

Do you have any recommendations for me? Streamchat or talk.js or better something else?

0 likes
1 reply
LaryAI's avatar
Level 58

For integrating a one-to-one chat feature in a Laravel 11 application using Vue and Inertia.js, I recommend considering Stream Chat or TalkJS. Both are robust solutions that provide extensive features out of the box, which can save you significant development time compared to building a chat system from scratch.

Stream Chat

Stream Chat is a powerful and scalable chat service that is easy to integrate with Laravel and Vue.js. It provides SDKs for various platforms, including a JavaScript SDK that works well with Vue.js.

  1. Integration Steps:

    • Sign up and create an application on the Stream website to get your API keys.
    • Install the Stream Chat SDK in your Laravel project:
      composer require get-stream/stream-chat
      
    • Use the Stream Chat JavaScript library in your Vue component:
      npm install stream-chat
      
    • Configure and initialize the Stream client in your Vue component:
      import { StreamChat } from 'stream-chat';
      const client = StreamChat.getInstance('YOUR_API_KEY');
      client.connectUser({ id: 'user_id', name: 'User Name' }, client.devToken('user_id'));
      
  2. Pros:

    • Highly scalable and feature-rich.
    • Good documentation and community support.
    • Provides features like threads, reactions, and typing indicators.
  3. Cons:

    • Pricing can be a concern for large-scale applications.

TalkJS

TalkJS is another excellent choice for integrating chat functionalities. It offers a chat UI kit that is easy to integrate with any web framework, including Vue.js.

  1. Integration Steps:

    • Sign up for TalkJS and get your API keys.
    • Install the TalkJS SDK:
      npm install talkjs
      
    • Initialize and configure TalkJS in your Vue component:
      import Talk from 'talkjs';
      Talk.ready.then(() => {
        const me = new Talk.User({
          id: '12345',
          name: 'Alice',
          email: '[email protected]',
          photoUrl: 'https://demo.talkjs.com/img/alice.jpg',
          welcomeMessage: 'Hey there! How can I help?'
        });
        const session = new Talk.Session({
          appId: 'YOUR_APP_ID',
          me: me
        });
        const other = new Talk.User({
          id: '54321',
          name: 'Bob',
          email: '[email protected]',
          photoUrl: 'https://demo.talkjs.com/img/bob.jpg',
          welcomeMessage: 'Hey, Alice!'
        });
        const conversation = session.getOrCreateConversation(Talk.oneOnOneId(me, other));
        conversation.setParticipant(me);
        conversation.setParticipant(other);
        const inbox = session.createInbox({ selected: conversation });
        inbox.mount(document.getElementById('talkjs-container'));
      });
      
  2. Pros:

    • Easy to integrate and customize.
    • Provides a ready-to-use chat UI.
    • Suitable for applications requiring direct and group messaging.
  3. Cons:

    • Less control over the backend compared to a fully custom solution.

Conclusion

Both Stream Chat and TalkJS offer comprehensive solutions for integrating chat functionalities into your Laravel and Vue application. Your choice depends on specific needs such as budget, scalability requirements, and desired features. For a quick integration with robust features, Stream Chat is highly recommended, while TalkJS is excellent for those who need a ready-made chat UI with less backend complexity.

Please or to participate in this conversation.