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

laive

v8.9.1

Published

Describe laive here

Downloads

18

Readme

laive

Laive is the platform to broadcast a live streaming into Living Apps. The main goal is to generate the necessary keys to broadcast to a rtmp and build a hls stream to consum.

To use laive in your Living App you need to have a credentials to connect (To get more info contact us).

Events data model

The events are the data piece needed to schedule a live streaming into Laive.

event: {
  background: urlImage,
  ended: bool,
  hls: urlHls, // not abailable if the event !isPublic
  isPublic: bool, // false: the user need validate a ticker to get the hls url
  startAt: Date,
  thumbnail: urlImage,
  title: string,
  status: 'idle' // idle, live, ended
}

Laive service

Singleton service to consume lives into your Living App.

import { Laive } from 'laive'

const laiveService = Laive()

// get the events that are in live
// An event is consider in live 30 mins before start (event.startAt)
laiveService.getLiveEvents({ appName: 'testing' }).then(({ events }) => {
  console.log(events)
})

// used to validate tickets, use it to get the hls url with ticketing events
laiveService.validateTicket({ 
  appName: 'testing', 
  eventId: 'event123', 
  ticket: '123456', 
  adminCode: 'codeXXX' 
}).then(({ valid, hls: data.hls }) => {
  // valid truo | false
  // hls url to consume the video
})

// this method is to count a user as viewer 
laiveService.createPresence({ 
  appName: 'testing', 
  eventId: 'event123' 
})

// Cancel the previus presence
laiveService.createPresence()

// get the total amount of users are viewing the live
const countUsers = laiveService.countUsers({ appName: 'testing', eventId: 'event123' })

useLaive

To use laive service as singleton into react.

import react, { useEffect, useState } from 'react'
import { useLaive } from 'laive'


// SplashScreen.js
export const SplashScreen = () => {
  const { initLaiveService } = useLaive()
  useEffect(() => {
    // execute it oly one time into the app
    // then you will be able use the service in this screen or other one
    initLaiveService()
  }, [])

  return ...
}

// LandingScreen.js
export const LandingScreen = () => {
  const { laiveService } = useLaive()
  useEffect(() => {
    // use any laiveService method
    laiveService.countUsers({ appName: 'testing', eventId: 'event123' })
  }, [])

  return ...
}

BackOffice

Service used to manage (create, edit, delete) events.

import { BackOffice } from 'laive'

const backOfficeService = BackOffice({ FIREBASE_APP_NAME: 'living_app_name' })


backOfficeService.login({ email: '[email protected]', password: '123456' }).then(user => {
  user
})

backOfficeService.logout()

backOfficeService.createEvent({ backgroundFile, thumbnailFile, ...EventModel }).then(() => ...)
// backgroundFile and thumbnailFile are optional
backOfficeService.updateEvent = async ({ eventId, backgroundFile, thumbnailFile, ...EventModel }).then(() => ...)
backOfficeService.getEvent({ eventId }).then(event => ...)
// forceRecreate -> If the event has already create tickets use it to force recreate them
backOfficeService.setTicketingEvent({ eventId, length = 10, forceRecreate = false })
backOfficeService.getEventTickets({ eventId })