npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lepuz/alo-chat-sdk

v1.2.4

Published

Alo Chat Sdk

Downloads

54

Readme

AloTech Chat SDK for React Native

AloTech Chat SDK for React Native is a plug‑and‑play live‑chat component that connects users of your mobile app with customer support in real time. It lets you focus on your app’s UX while the SDK handles all messaging plumbing.

Installation

npm install @lepuz/alotech-chat-sdk
# or
yarn add @lepuz/alotech-chat-sdk

For iOS, remember to link native deps:

cd ios && pod install

Usage

import React, { useRef } from 'react';
import ChatScreen, { type ChatRefType } from '@lepuz/alotech-chat-sdk';

const App = () => {
  const chatRef = useRef<ChatRefType>({});

  return (
    <ChatScreen
      clientEmail="[email protected]"
      clientName="John Doe"
      cwid="YOUR_CWID"
      namespace="YOUR_NAMESPACE"
      phone_number="+1234567890"
      security_token="YOUR_SECURITY_TOKEN"
      chatRef={chatRef}
      onClose={() => console.log('Chat closed')}
      onChatStarted={(info) => console.log('Chat started:', info)}
      onContinueLater={() => console.log('User chose to continue chat later')}  {/* NEW */}
    />
  );
};

export default App;

Tip: To end the conversation programmatically, call chatRef.current?.endChat(). This method both closes the UI and notifies the AloTech API. Manually doing chatRef.current?.setChatEnded(true) is possible but not recommended.

Props Reference

| Prop | Type | Required | Description | | ------------------ | ------------------------------ | -------- | ------------------------------------------------------------------------------------- | | clientEmail | string | Yes | End‑user's email. | | clientName | string | Yes | End‑user's full name. | | cwid | string | Yes | Company/workspace ID provided by AloTech. | | namespace | string | Yes | Chat namespace / tenant identifier. | | phone_number | string | No | User's phone in E.164 format. | | security_token | string | Yes | Token for authenticating the session. | | chatRef | React.RefObject<ChatRefType> | No | New. Exposes imperative methods & state (see Chat Ref API). | | customHeader | ReactElement | No | Override the default header UI. | | onClose | ( ) ⇒ void | No | Fired when the user closes the screen. | | initialChatToken | string | No | Resume token for an existing chat. | | initialChatKey | string | No | Resume key for an existing chat. | | onChatStarted | (info: ChatInfo) ⇒ void | No | Fired after a fresh chat is created. | | onContinueLater | ( ) ⇒ void | No | New. Fired when the user chooses to continue the chat later instead of ending it. | | memberId | string | No | Optional custom user metadata (e.g., user/member ID for analytics or CRM systems). | | transaction | string | No | Optional transaction/session identifier to track user context or origin. | | initialTheme | 'light' \| 'dark' | No | Optional theme setting to control the chat UI appearance. Defaults to 'light' if not specified. |

Chat Ref API

When you pass chatRef, the SDK sets the following fields on chatRef.current:

| Field / Method | Type / Signature | Purpose | | ------------------------- | ------------------------ | ---------------------------------------------------------------------------- | | endChat() | () ⇒ void | Closes the chat and notifies AloTech. Preferred over manual state changes. | | messages | MessageType[] | Current list of messages. | | setMessages(messages) | (MessageType[]) ⇒ void | Replace the message list. | | chatEnded | boolean | true if the chat is closed. | | setChatEnded(chatEnded) | (boolean) ⇒ void | Manually flag chat as ended (avoid; use endChat()). | | loading | boolean | true while the SDK is starting / reconnecting. | | setLoading(loading) | (boolean) ⇒ void | Force‑set the loading state (rarely needed). |


Features

AloTech Chat SDK comes with several useful features out-of-the-box:

  • WebSocket-based real-time messaging: Uses WebSocket connections for instant, bi-directional communication.
  • Message retry mechanism: Built-in retry logic for reliable message delivery.
  • Chat queue & typing indicators: Supports queuing chats, waiting indicators, and agent typing indicators.
  • Customizable header and interface: Match your app’s branding with customizable headers and styles.
  • End-of-chat handling and clean-up: Properly closes and cleans up after chat sessions.
  • Continue later handling: Allows users to opt to continue the chat later, giving you control over related user experience flows.