
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@arkeytyp/valu-api
Advanced tools
A package for developing iframe applications for Valu Social. Allows invoking functions of registered Valu applications and subscribing to events, as well as other features that enable developers creating own ifram apps for the value social
The valu-api package enables developers to create custom iframe applications for Valu Social. It provides tools to invoke functions of registered Valu applications and subscribe to their events. With features like API versioning, event handling, and console command testing, developers can seamlessly integrate and extend functionality within the Valu Social ecosystem.
npm install @arkeytyp/valu-api
On your application startup, create an instance of ValuApi and subscribe to the API_READY event. This event will be triggered only when your application is launched as an iframe within the Valu Verse application.
import { ValuApi } from 'valu-api';
const valuApi = new ValuApi();
valuApi.current.addEventListener(ValuApi.API_READY, async (e) => {
console.log("API IS READY!!!");
});
Once the API is ready, you can create an APIPointer instance by specifying the name and version of the API you want to use. The version parameter is optional, and if omitted, the latest version will be used.
To get a pointer to the app API version 1:
const appApi = valuApi.getApi('app', 1);
To use the latest version of the API:
const appApi = valuApi.current.getApi('app');
After obtaining the API pointer, you can invoke commands on the API. Here's an example of opening the text_chat on the app API:
await appApi.run('open', 'text_chat');
For interacting with other APIs, like the chat API:
const chatApi = valuApi.current.getApi('chat');
await chatApi.run('open-channel', { roomId: 'room123', propId: 'prop456' });
You can subscribe to events emitted by the API. For example, if you want to listen for the app-open event:
appApi.addEventListener('app-open', (event) => {
console.log(event);
});
You can use the runConsoleCommand method to execute commands directly in the console environment. This method processes the output and returns a resolved promise on success or an error message if the command fails.
To run a console command, use:
let command = 'app open text_chat';
let reply = await valuApi.current.runConsoleCommand(command);
console.log(reply);
command = 'chat open-channel roomId xz21wd31tx83kk propId 812t26xbq5424b';
reply = await valuApi.current.runConsoleCommand(command);
console.log(reply);
Here's an example of a simple workflow using valu-api:
import { ValuApi } from 'valu-api';
const valuApi = new ValuApi();
// Wait for the API to be ready
valuApi.current.addEventListener(ValuApi.API_READY, async () => {
console.log("API IS READY!!!");
// Get API pointer
const appApi = valuApi.current.getApi('app');
// Run a command on the app API
await appApi.run('open', 'text_chat');
// Subscribe to events
appApi.addEventListener('app-open', (event) => {
console.log('App opened:', event);
});
// Run console command for testing
let command = 'app open text_chat';
let reply = await valuApi.current.runConsoleCommand(command);
console.log(reply);
});
FAQs
A package for developing iframe applications for Valu Social. Allows invoking functions of registered Valu applications and subscribing to events, as well as other features that enable developers creating own ifram apps for the value social
The npm package @arkeytyp/valu-api receives a total of 83 weekly downloads. As such, @arkeytyp/valu-api popularity was classified as not popular.
We found that @arkeytyp/valu-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.