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

stream-player-temp

v1.1.28

Published

This module provides configuration and utility functions for interacting with Isometrik's API and MQTT services. The configuration is dynamically loaded from a global configuration object, which allows it to be easily customized for different projects.

Downloads

10

Readme

Project Configuration and API Utilities

This module provides configuration and utility functions for interacting with Isometrik's API and MQTT services. The configuration is dynamically loaded from a global configuration object, which allows it to be easily customized for different projects.

Configuration

The configuration properties are loaded from the global window.__stream_player_config object. Ensure this object is not altered in your project.

Example Configuration Object

  • isometrikBaseApiUrl: "https://apis.isometrik.io"
  • baseApiUrl: "https://api.soldlive.eu"
  • liveKitUrl: "wss://streaming.isometrik.io"
  • MQTTHost: "connections.isometrik.io"
  • projectCreds:
    • accountId: "652f9ad3e24477cce4a025d5"
    • projectId: "88cad458-e9a0-4109-a2d6-df520e56b4f7"
    • keySetId: "b17b380d-153e-4017-8a8f-26b61f5c23c8"
    • licenseKey: "lic-IMKm3wNSIeSnxmdj/lOy4mB55sziy2A1NhU"
    • appSecret: "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADbQAAAAlhY2NvdW50SWRtAAAAGDY1MmY5YWQzZTI0NDc3Y2NlNGEwMjVkNW0AAAAIa2V5c2V0SWRtAAAAJGIxN2IzODBkLTE1M2UtNDAxNy04YThmLTI2YjYxZjVjMjNjOG0AAAAJcHJvamVjdElkbQAAACQ4OGNhZDQ1OC1lOWEwLTQxMDktYTJkNi1kZjUyMGU1NmI0ZjdkAAZzaWduZWRuBgAyh_ZBiwE.u0RqujyPa8EB036aYWH50kME2sMLgjC7faUtYTJxHFM"
    • userSecret: "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADbQAAAAlhY2NvdW50SWRtAAAAGDY1MmY5YWQzZTI0NDc3Y2NlNGEwMjVkNW0AAAAIa2V5c2V0SWRtAAAAJGIxN2IzODBkLTE1M2UtNDAxNy04YThmLTI2YjYxZjVjMjNjOG0AAAAJcHJvamVjdElkbQAAACQ4OGNhZDQ1OC1lOWEwLTQxMDktYTJkNi1kZjUyMGU1NmI0ZjdkAAZzaWduZWRuBgAyh_ZBiwE.nWn8_aZvCwqH1smL9Mp8tgYeG4S04WWSrbwczusX5Cg"
  • userProfileData:
    • userId & _id
    • name
    • firstName
    • lastName
    • profilePic
    • senderIdentifier
    • isomatricChatUserId
  • streamData:
    • status: "STARTED"/"SCHEDULED"/"ENDED"
    • isScheduledStream
    • streamId
    • _id
    • metaData
    • isStreamActive
    • streamDescription
  • noUserCallBack: () => {}
  • alertFunction: () => {}

Exported Configuration Properties

ISOMETRIK_BASE_API_URL (isometrikBaseApiUrl)

This constant holds the base URL for the Isometrik API, loaded from the configuration.

BASE_API_URL (baseApiUrl)

This constant holds the base URL for project API, loaded from the configuration.

PROJECTS_CREDS configProps('projectCreds')

This constant holds the project credentials required for API and MQTT authentication, loaded from the configuration.

noUserCallBack

This function handles restriction middleware It is used if stream viewer is a guest and u want to add some type of restriction Tries to buy a product you can move it to signIn screen / dialog

const noUserCallBack = () => { document.getElementById('profile_svg_header')?.click(); } const alertFunction = (type, data) => { if (type == 'showSnackbar') { showSnackbar(data); } }

Isometrik MQTT Credentials

The MQTT credentials are constructed using the project credentials. These credentials are used to connect to the Isometrik MQTT broker.

ISOMETRIK_MQTT_CREDS

const ISOMETRIK_MQTT_CREDS = { URL: 'connections.isometrik.io', Username: '2' + PROJECTS_CREDS.accountId + PROJECTS_CREDS.projectId, Password: PROJECTS_CREDS.licenseKey + PROJECTS_CREDS.keySetId, API_URL: 'https://apis.isometrik.io', };

MQTT Topics

The MQTT topics are constructed using the project credentials. These topics are used to subscribe to various events and messages.

ISOMETRIK_MQTT_TOPICS

const ISOMETRIK_MQTT_TOPICS = { Message: /${PROJECTS_CREDS.accountId}/${PROJECTS_CREDS.projectId}/Message/, PresenceEvents: /${PROJECTS_CREDS.accountId}/${PROJECTS_CREDS.projectId}/Status/, NewMessageEvent: /${PROJECTS_CREDS.accountId}/${PROJECTS_CREDS.projectId}/, userEvents: /${PROJECTS_CREDS.accountId}/${PROJECTS_CREDS.projectId}/Users/, };

Utility Functions

getUrl(endpoint)

A function to construct the full API URL for a given endpoint.

const getUrl = (endpoint) => { return ISOMETRIK_BASE_API_URL + endpoint; };

Common Headers

The common headers required for API requests, including authorization details.

const commonHeader = { licenseKey: PROJECTS_CREDS.licenseKey, appSecret: PROJECTS_CREDS.appSecret, "Content-Type": "application/json" };

getIsometrik(endpoint, otherHeaders)

An asynchronous function to make GET requests to the Isometrik API with the necessary headers.

const getIsometrik = async (endpoint = "", otherHeaders = {}) => fetch(getUrl(endpoint), { method: "GET", headers: { ...commonHeader, ...otherHeaders, }, }); Usage Ensure your project includes the necessary configuration in window.__stream_player_config. Import the module and use the provided constants and functions as needed.