
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
@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 build custom iframe applications for Valu Social.
It provides tools to invoke functions on registered Valu applications, subscribe to their events, and communicate via intents.
With features like API versioning, event handling, and console command execution, you can seamlessly integrate and extend functionality within the Valu Social ecosystem.
npm install @arkeytyp/valu-api
On application startup, create an instance of ValuApi and subscribe to the API_READY event.
This event is triggered only when your application is launched as an iframe within the Valu Verse application.
import { ValuApi } from "@arkeytyp/valu-api";
const valuApi = new ValuApi();
valuApi.addEventListener(ValuApi.API_READY, async (e) => {
console.log("API IS READY!");
});
Intents are a powerful way to communicate with other applications inside Valu Social.
They allow your application to request actions from other registered apps in a standardized way — for example, opening a chat, joining a meeting, or performing any supported operation.
Each Intent contains:
open, connect-to-meeting).import { Intent } from "@arkeytyp/valu-api";
const intent = new Intent('videochat');
await valuApi.sendIntent(intent);
First, get the current user ID using the users API:
import { Intent } from "@arkeytyp/valu-api";
const usersApi = await valuApi.getApi('users');
const currentUser = await usersApi.run('current');
if (!currentUser) {
console.error('Something went wrong');
return;
}
const intent = new Intent('textchat', 'open-channel', { userId: currentUser.id });
await valuApi.sendIntent(intent);
Invoking a Service works almost the same way as running an Application Intent.
You still use the same Intent object with applicationId, action, and optional params — the key difference is what the applicationId points to and how the call affects the UI.
When calling a Service Intent:
applicationId refers to the service name (e.g., ApplicationStorage), not a visible UI application.This makes Services a parallel mechanism to Application Intents, with the difference that they target non-UI services instead of interactive apps.
ApplicationStorage ServiceBelow is an example of using an Intent to query the ApplicationStorage service to search for resources:
const intent = new Intent('ApplicationStorage', 'resource-search', {
size: 10,
});
const result = await valuApi.callService(intent);
The valu-api package lets your iframe app handle application lifecycle events.
By extending ValuApplication and registering it with ValuApi, you can respond when your app is created, receives a new intent, or is destroyed.
This helps you separate application logic from API wiring and makes handling incoming intents straightforward.
import { ValuApplication } from '@arkeytyp/valu-api';
class MyApp extends ValuApplication {
async onCreate(intent) {
console.log('App created with:', intent);
return { status: 'initialized' };
}
async onNewIntent(intent) {
console.log('New intent received:', intent);
return { handled: true, data: { message: 'Processed successfully' } };
}
onDestroy() {
console.log('App is shutting down');
}
}
import { ValuApi } from '@arkeytyp/valu-api';
const valuApi = new ValuApi();
valuApi.setApplication(new MyApp());
Lifecycle Methods:
onCreate(intent) — Triggered when the application is first launched with an intent.onNewIntent(intent) — Triggered when a new intent is sent while the application is already running.onDestroy() — Triggered when the application is about to be destroyed.[onCreate] → [onNewIntent] (0..N times) → [onDestroy]
The System API allows your iframe app to interact directly with the Valu Social platform and its internal applications.
It provides a unified way to:
Once the API is ready, you can get an APIPointer by specifying the API name and (optionally) the version.
const appApi = await valuApi.getApi('app', 1); // Specific version
const appApiLatest = await valuApi.getApi('app'); // Latest version
After obtaining the API pointer, you can invoke commands.
For example, to get the current network id:
const networkApi = await valuApi.getApi('network');
const networkId = await networkApi.run('id');
console.log(networkId);
You can subscribe to events emitted by the API.
For example, listen for the app-open event:
const appApi = await valuApi.getApi('app');
appApi.addEventListener('app-open', (event) => {
console.log(event);
});
Use runConsoleCommand to execute commands directly in the console environment.
const reply = await valuApi.runConsoleCommand('network id');
console.log(reply);
You can also use the console to run intents — the following two examples achieve the same result:
Via API:
import { Intent } from "@arkeytyp/valu-api";
const usersApi = await valuApi.getApi('users');
const currentUser = await usersApi.run('current');
if (!currentUser) {
console.error('Something went wrong');
return;
}
const intent = new Intent('textchat', 'open-channel', { userId: currentUser.id });
await valuApi.sendIntent(intent);
Via Console:
const currentUser = await valuApi.runConsoleCommand('users current');
const reply = await valuApi.runConsoleCommand(
`app run -applicationId textchat -action open-channel -userId ${currentUser.id}`
);
console.log(reply);
We've created a sample application integrated with Valu API.
Check out the repository here and feel free to leave comments or feedback:
https://github.com/Roomful/ValuSampleApp know if you want a quick start section, more real-world samples, or even a troubleshooting/FAQ block!
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
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.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.