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

@valota/my-content-client

v2.0.0

Published

A Javascript client for Valotalive digital signage My Content API.

Downloads

6

Readme

Valotalive Logo

Valotalive - Javascript (NodeJS) Client for My Content API

This is a helper library for Valotalive Digital Signage My Content API. You have to have at least one My Content activated in our system to use this library.

Requirements

See dependencies from package.json

Installation

Use npm
npm install @valota/my-content-client

Usage

import {MyContentClient, PostMessage, PDFPage} from '@valota/my-content-client';

// Initialize your client
const client = new MyContentClient(API_KEY, API_SECRET);


// get basic information
client.information().then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});





// Post
const post = new PostMessage();
post.setTitle("Title of the post");
post.setMessage("Message of the post");
post.setMedia('/abs/path/to/media.jpg');
post.setDisplayTime(10);//seconds
post.setSchedule([{from:1735693261, to:1735729871}]);

// All are optional, but post has to have at least one of title, message or media.
client.post(post).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});


// Edit

const edit = new EditMessage(1234);
edit.setTitle("Edited title");// empty string unsets
edit.setMessage("Edited message");// empty string unsets
edit.setDisplayTime(0);// 0 unsets
edit.setSchedule([]); //empty array unsets schedule
// All are optional. Only changes the values that are set.
client.edit(edit).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});



// List all messages
client.list().then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});

// Get one message
client.get(messageId).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});

// Archive a message
client.archive(messageId).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});

// Restore a message from the archive
client.restore(messageId).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});

// Delete a message permanently
client.delete(messageId).then(res => {
	console.log(res);
}).catch(err => {
	console.log(err.status);
	err.json().then(er => console.log(er));
});

API description has more detailed information about responses and arguments at https://github.com/Valota/my-content-api

Links

  • Valotalive: https://valota.live
  • My Content Channel: https://valota.live/apps/my-content/
  • My Content API description: https://github.com/Valota/my-content-api