
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@companycam/vibe-check
Advanced tools
Welcome to the CompanyCam Vibe Check repo. This library is largely for exposing hardware information in some key areas that an app may be known to slow down in. As we all know, the largest issues app developers are faced with stem from performance issues. Sometimes we can mitigate for these issues, and sometimes we cannot. This library aims to expose pertinent information related to areas in the hardware that can cause performance issues.
As of right now, this library exposes the following information, through the getCurrentVibes method:
{
battery: {
batteryLevel: 0.5,
batteryState: 'unplugged',
lowPowerMode: false,
isBatteryCharging: false,
},
connectivity: {
isConnected: true,
isInternetReachable: true,
type: 'cellular',
details: {
isConnectionExpensive: false,
cellularGeneration: '4g',
},
},
thermalState: 'fair',
ramUsage: 20, // <-- percentage
diskUsage: 80 // <-- percentage
}
yarn install @companycam/companycam-vibe-check
yarn add companycam-vibe-check
iOS Version: 15.0
minSdkVersion: 24
import { getCurrentVibes } from 'companycam-vibe-check';
// ...elsewhere in your code
const { vibes } = await NativeModules.VibeChecker.getCurrentVibes();
Gets the device's current hardware information. This method is the main entry point for this library. Returns all of the results from the other functions this library exposes.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { currentVibe } = await NativeModules.VibeChecker.getCurrentVibes();
This method will return an object very similar to the below JSON object:
{
battery: {
batteryLevel: 0.5,
batteryState: 'unplugged',
lowPowerMode: false,
isBatteryCharging: false,
},
connectivity: {
isConnected: true,
isInternetReachable: true,
type: 'cellular',
details: {
isConnectionExpensive: false,
cellularGeneration: '4g',
},
},
thermalState: 'fair',
ramUsage: 20, // <-- percentage
diskUsage: 80 // <-- percentage
}
This method allows you to customize how long the library caches the hardware information. Currently the default for the timeout is X seconds. Setting this value to 0 will query the hardware, in real time, instead of relying on the cached values.
import { VibeChecker } from '@companycam/companycam-vibe-check';
await NativeModules.VibeChecker.setVibeTimeout(120);
const { vibeTimeout } = NativeModules.VibeChecker.getVibeTimeout();
The parameter for setVibeTimeout() is a number in seconds. The return value for getVibeTimeout() is a number in seconds.
📝 NOTE: In the future we may allow configuration on the time measurements (seconds vs. minutes, etc.)
Gets the device's current Battery information.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { battery } = await NativeModules.VibeChecker.getBatteryVibe();
This method will return an object very similar to the below JSON object:
battery: {
batteryLevel: 0.5,
batteryState: 'unplugged',
lowPowerMode: false,
isBatteryCharging: false,
}
Gets the device's current Network Connection information.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { connection } = await NativeModules.VibeChecker.getConnectionVibe();
This method will return an object very similar to the below JSON object:
connection: {
isConnected: true,
isInternetReachable: true,
type: 'cellular',
details: {
isConnectionExpensive: false,
cellularGeneration: '4g',
},
}
Gets the device's current Disk usage, as a percentage.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { diskUsage } = await NativeModules.VibeChecker.getDiskUsage();
This method will return an object very similar to the below JSON object:
diskUsage: 80; // <-- percentage
Gets the device's current RAM usage, as a percentage.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { ramUsage } = await NativeModules.VibeChecker.getRamUsage();
This method will return an object very similar to the below JSON object:
ramUsage: 80; // <-- percentage
Gets the device's current thermal state.
import { VibeChecker } from '@companycam/companycam-vibe-check';
const { thermalState } = await NativeModules.VibeChecker.getThermalState();
This method will return an object very similar to the below JSON object:
thermalState: 'fair';
📝 NOTE: Since iOS and Android expose different thermal states, we've normalized them. Currently we use iOS nomenclature for the different thermal states. Please refer to the table below.
| thermalState | iOS Value | Android Value |
|---|---|---|
nominal | nominal | THERMAL_STATUS_NONE / THERMAL_STATUS_LIGHT |
fair | fair | THERMAL_STATUS_MODERATE |
serious | serious | THERMAL_STATUS_SEVERE |
critical | critical | THERMAL_STATUS_CRITICAL / THERMAL_STATUS_EMERGENCY |
| Property | Type | Description |
|---|---|---|
| batteryLevel | number | The battery level on the device, from 0.0 to 1.0 |
| batteryState | string | 'unknown', 'unplugged, 'charging' |
| lowPowerMode | bool | Whether or not the device is in low power mode |
| isCharging | bool | Whether or not the device is charging |
| Property | Type | Description |
|---|---|---|
| isConnected | bool | Whether or not the device is connected to the internet |
| isInternetReachable | bool | Whether or not the device is connected to the internet |
| type | string | 'none', 'unknown', 'cellular', 'wifi', 'bluetooth', 'ethernet', 'wimax', 'vpn' |
| details | object | See below |
| Property | Type | Description |
|---|---|---|
| isConnectionExpensive | bool | Whether or not the connection is expensive |
| cellularGeneration | string | '2g', '3g', '4g', '5g', 'unknown' |
| Property | Type | Description |
|---|---|---|
| thermalState | string | 'nominal', 'fair', 'serious', 'critical' |
| Property | Type | Description |
|---|---|---|
| ramUsage | number | RAM Usage on the device from 0.0 to 1.0 |
This project uses conventional commits and semantic-release to automate the release process. Please follow the conventional commits format when making commits.
See the contributing guide to learn how to contribute to the repository and the development workflow.
Made with create-react-native-library
FAQs
Hardware logging library for CompanyCam
The npm package @companycam/vibe-check receives a total of 1,938 weekly downloads. As such, @companycam/vibe-check popularity was classified as popular.
We found that @companycam/vibe-check demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 79 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
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.