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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gomagaming/messenger

v0.4.0

Published

Embeddable chat widget web component for Goma Gaming

Downloads

95

Readme

@gomagaming/messenger

Embeddable chat widget for Goma Gaming platforms. Ships as a Web Component (<goma-messenger>) with Shadow DOM isolation — drop it into any frontend framework or vanilla HTML page.

Quick Start

npm install @gomagaming/messenger

Import once to register the custom element:

import '@gomagaming/messenger'

Add the element to your page:

<goma-messenger
  api-url="https://api.example.com"
  socket-url="https://ws.example.com"
  auth-token="<user-jwt>"
  socket-auth-token="<static-socket-token>"
  user-chat-id="<user-id>"
  locale="en"
  position="fixed"
></goma-messenger>

The widget renders a floating chat bubble (fixed mode) or inline panel (inline mode). It bootstraps automatically once auth-token and api-url are set.

Authentication Flow

  1. User authenticates with your backend and obtains a JWT.
  2. Set auth-token and user-chat-id attributes on the element.
  3. The widget connects to Socket.IO and loads conversations.
  4. To log out, remove auth-token — the widget disconnects and hides.

Attributes

| Attribute | Required | Description | |-----------|----------|-------------| | api-url | Yes | Base URL for the Goma social API | | socket-url | Yes | Socket.IO server URL | | auth-token | Yes | User JWT — gates widget rendering | | socket-auth-token | Yes | Static token for socket authentication | | user-chat-id | Yes | Current user's ID in the chat system | | locale | No | Language (en, pt, fr, tr, da). Default: en | | position | No | fixed (bubble+panel) or inline. Default: fixed | | theme | No | JSON string of CSS variable overrides | | enable-ticket-sharing | No | Enable bet ticket sharing (true/false) | | username | No | Display name for the current user | | user-avatar | No | Avatar URL for the current user | | user-code | No | Friend code for adding contacts | | font-url | No | Font stylesheet URL. Defaults to Google Fonts Exo 2. Set to none to disable. | | demo | No | Demo mode — bypasses real API/socket and uses scripted mock data |

See the full attribute reference for all options.

Events

Listen for custom events on the element:

const messenger = document.querySelector('goma-messenger')

messenger.addEventListener('gc:message-received', (e) => {
  console.log('New message:', e.detail)
})

messenger.addEventListener('gc:unread-count', (e) => {
  console.log('Unread:', e.detail.count)
})

Available events: gc:connected, gc:disconnected, gc:message-received, gc:message-sent, gc:unread-count, gc:friend-added, gc:open, gc:close, gc:tail-bet, gc:error.

See the full events reference.

Imperative API

The element exposes two methods for host-driven open/close:

const messenger = document.querySelector('goma-messenger')
messenger.open()   // opens the chat panel
messenger.close()  // closes the chat panel

CSS Theming

Override the default dark theme via the theme attribute:

<goma-messenger theme='{"--gc-bg-primary": "#1a1a2e", "--gc-highlight-primary": "#e94560"}'></goma-messenger>

Pre-built theme presets are also exported and can be applied at runtime:

import { exclusivebetTheme, betssonfranceTheme } from '@gomagaming/messenger'

const messenger = document.querySelector('goma-messenger')
messenger.setAttribute('theme', JSON.stringify(exclusivebetTheme))

See the full CSS variables reference.

Documentation

Full documentation is available in the docs/ directory. To run the docs site locally:

npm run docs:dev

This starts a VitePress dev server at http://localhost:5173. The docs cover integration guides, framework-specific examples (React, Vue, Angular), styling, i18n, and the complete API reference.

Development

npm install
npm run dev          # Watch mode build
npm run demo         # Dev server with demo page
npm run test         # Run tests
npm run build        # Production build

License

Proprietary - Goma Gaming