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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@applozic/core-sdk

v1.4.0

Published

Applozic Core SDK

Downloads

30

Readme

Deploy Core SDK

Applozic Core JavaScript SDK

Installation

$ npm i @applozic/core-sdk

Initialize

1. Using npm import

import ApplozicClient from '@applozic/core-sdk';
const applozicClient = new ApplozicClient('YOUR-APPLOZIC-APP-ID', {
  events: {
    onMessageReceived: ({ message }) => {
      console.log('onMessageReceived', { message });
    },
    onMessageDelivered: (contactId, messageKey) => {
      console.log('onMessageDelivered', { message });
    },
    onMessageRead: (contactId, messageKey) => {
      console.log('onMessageRead', { contactId, messageKey });
    },
    onMessageSent: ({ message }) => {
      console.log('onMessageSent', { message });
    },
    onMessageSentUpdate: message => {
      console.log('onMessageSentUpdate', { sentMessageUpdate: message });
    },
    onMessageDeleted:  (contactId, messageKey) => {
      console.log('onMessageDeleted', { contactId, messageKey });
    },
    onConversationRead: userId => {
       console.log('onConversationRead', { userId });
    },
    onConversationDeleted: contactId => {
      console.log('onConversationDeleted', { contactId });
    },
    onUserActivated: message => {
      console.log('onUserActivated', { onUserActivated: message });
    },
    onUserConnect: message => {
      console.log('onUserConnect', { userConnected: message });
    },
    onUserOnlineStatus: (userId, isOnline, timestamp) => {
     console.log('onUserOnlineStatus', { userId, isOnline,  timestamp});
    },
    onTypingStatus: (userId, status) => {
      console.log('onTypingStatus', { userId, status});
    }
  }
});

2. Using script tag

<!DOCTYPE html>
<head>
  <meta charset="utf-8" />
  <title>Development</title>
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <script src="https://websdk.applozic.com/sdk.js"></script>
  <script>
    var applozicClient = new alClient('YOUR-APPLOZIC-APP-ID', {
      events: {
        onMessageReceived: ({ message }) => {
          console.log('onMessageReceived', { message });
        },
        onMessageDelivered: (contactId, messageKey) => {
          console.log('onMessageDelivered', { message });
        },
        onMessageRead: (contactId, messageKey) => {
          console.log('onMessageRead', { contactId, messageKey });
        },
        onMessageSent: ({ message }) => {
          console.log('onMessageSent', { message });
        },
        onMessageSentUpdate: message => {
          console.log('onMessageSentUpdate', { sentMessageUpdate: message });
        },
        onMessageDeleted: (contactId, messageKey) => {
          console.log('onMessageDeleted', { contactId, messageKey });
        },
        onConversationRead: userId => {
          console.log('onConversationRead', { userId });
        },
        onConversationDeleted: contactId => {
          console.log('onConversationDeleted', { contactId });
        },
        onUserActivated: message => {
          console.log('onUserActivated', { onUserActivated: message });
        },
        onUserConnect: message => {
          console.log('onUserConnect', { userConnected: message });
        },
        onUserOnlineStatus: (userId, isOnline, timestamp) => {
          console.log('onUserOnlineStatus', { userId, isOnline, timestamp });
        },
        onTypingStatus: (userId, status) => {
          console.log('onTypingStatus', { userId, status });
        }
      }
    });
  </script>
</head>
<html>
  <body>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>
  </body>
</html>

Login a user

const isUserLoggedIn = async () => {
  await applozicClient.init(); // Starts listening for events if user already logged in
  if (applozicClient.loginResult) {
    console.log({ loginResult: applozicClient.loginResult });
    return true;
  }
  return false;
};

const login = async (userId, password) => {
  if (await isUserLoggedIn()) {
    // User is already logged in
    // loginResult = applozicClient.loginResult;
    // You can use `await applozicClient.logout()` to log out current user
  } else {
      const loginResult = await applozicClient.login('userId', 'password')
  }
};

Logout a user

await applozicClient.logout()

APIs

Detailed documentation of the APIs can be found in the Applozic Core SDK.

ApplozicClient

ContactsApi

MessagesApi

FilesApi

GroupsApi


Changelog

https://github.com/AppLozic/Applozic-JS-SDK/blob/main/packages/core/CHANGELOG.md