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

indie-widget-chat

v0.11.0

Published

## Features - Multi Type and Multi Profile for Seller type user. - Product and Order chat content. - Send Media (Image), Order, Promotion (soon).

Downloads

35

Readme

Indie Widget Chat - IMCeria

Features

  • Multi Type and Multi Profile for Seller type user.
  • Product and Order chat content.
  • Send Media (Image), Order, Promotion (soon).

Tech Stack

Installation

Install Indie Widget Chat via npm.

npm install indie-widget-chat

to add this widget to your app you can add this specific tag below.

<indie-widget-chat id="widget_chat" ref="refChat"></indie-widget-chat>

API

Prequisites

First of all to using this widget you need to initialize it first. Indie Widget Chat accept two arguments which is options and callback.

_init(_options = {}, cb = (_obj: any) => {})

at least you need to send the options argument that should be exactly look like this :

const options = {
    envProduction: _boolean_,
    credential: _string_,
    headUrl: _string_,
    tokenUser: _string_,
    tokenChamo: _string_
}
  • envProduction : (Boolean | true/false) taken from app deploy state.
  • credential : (String) from which platform this widget is used.
  • headUrl : (String)* which head url this app will going to use to fetch the data.

    (*) seller: for Seller Platform. pos: for POS Platform. whitelabel: for Whitelabel platform.

  • tokenUser : (String) token user from SSO.
  • tokenChamo : (String) token chamo from Chamo.

init()

You can do by directly accessing the dom itself.

document.getElementById('widget_chat').init(_firstArg, _secondArg)

attachChatContent()

You can send attachment using the by sending specific payload along with it's selected data (Product / Order / Promotion) to attachChatContent function. See the details below.

const data: {
    config: {
      type: _string_,
      profile_type: _integer_,
      target_id: _string,
      target_type: _integer_
    },
    payload: {
      ...attachedContentData
    }
}
  • type: (String) attached content type (product, order, promotion).
  • profile_type: (Integer) what kind of user this chat represent (0 for User/Whitelabel, 1 for Staff, 2 for Brand, 3 for Branch/Store).
  • target_id: (String) reference_id/user_id of targeted user.
  • target_type: (String) to what kind of user this chat is send (0 for User/Whitelabel, 1 for Staff, 2 for Brand, 3 for Branch/Store).
  • attachedContentData: (Object) attached content.

Then proceed to attach content to chat, see example below.

document.getElementById('widget_chat').attachChatContent(data)

References