Skip to main content

getServerInfo()

Retrieves metadata and system information about the BlueBubbles server.
const info = await sdk.server.getServerInfo();

Returns

info
ServerMetadataResponse
Server metadata and system information

ServerMetadataResponse

Contains detailed information about the server’s configuration, status, and capabilities.

Fields

os_version
string
macOS version running on the serverExample: "14.2.1"
server_version
string
BlueBubbles server versionExample: "1.9.0"
private_api
boolean
Whether Private API is enabled (required for advanced features)Example: true
helper_connected
boolean
Whether the Private API helper bundle is connectedExample: true
detected_icloud
string
iCloud account email address detected on the serverExample: "[email protected]"
detected_icloud_name
string
Display name associated with the iCloud accountExample: "John Doe"
detected_imessage
string
Primary iMessage phone number or emailExample: "+1234567890"
macos_time_sync
number | null
Time synchronization offset between server and macOS (in milliseconds)Example: 0
local_ipv4s
string[]
Array of local IPv4 addresses for the serverExample: ["192.168.1.100", "10.0.0.5"]
local_ipv6s
string[]
Array of local IPv6 addresses for the serverExample: ["fe80::1"]
computer_id
string
Unique identifier for the server computerExample: "ABC12345-6789-DEF0-1234-56789ABCDEF0"

Example

Retrieve and display server information:
import { AdvancedIMessageKit } from '@photon-ai/advanced-imessage-kit';

const sdk = new AdvancedIMessageKit({
  serverUrl: 'http://localhost:1234',
  password: 'your-password'
});

await sdk.connect();

// Get server info
const info = await sdk.server.getServerInfo();

console.log('Server Information');
console.log('==================');
console.log(`OS Version: ${info.os_version}`);
console.log(`Server Version: ${info.server_version}`);
console.log(`Private API: ${info.private_api ? 'enabled' : 'disabled'}`);
console.log(`Helper Connected: ${info.helper_connected ? 'yes' : 'no'}`);

if (info.detected_icloud) {
  console.log(`\niCloud Account:`);
  console.log(`  Email: ${info.detected_icloud}`);
  if (info.detected_icloud_name) {
    console.log(`  Name: ${info.detected_icloud_name}`);
  }
}

if (info.detected_imessage) {
  console.log(`\niMessage Handle: ${info.detected_imessage}`);
}

if (info.local_ipv4s && info.local_ipv4s.length > 0) {
  console.log(`\nLocal IP Addresses:`);
  info.local_ipv4s.forEach(ip => console.log(`  - ${ip}`));
}

// Check capabilities
if (!info.private_api) {
  console.warn('\n⚠️  Private API is not enabled. Some features may be unavailable.');
}

if (!info.helper_connected && info.private_api) {
  console.warn('\n⚠️  Private API helper is not connected.');
}

Use Cases

Server Health Check

Verify the server is properly configured:
const info = await sdk.server.getServerInfo();

const isHealthy = info.private_api && info.helper_connected;

if (isHealthy) {
  console.log('✅ Server is healthy and ready');
} else {
  console.log('❌ Server configuration issues detected');
}

Version Compatibility Check

Ensure the server meets minimum version requirements:
const info = await sdk.server.getServerInfo();
const [major, minor, patch] = info.server_version.split('.').map(Number);

const requiredVersion = { major: 1, minor: 9, patch: 0 };

if (
  major > requiredVersion.major ||
  (major === requiredVersion.major && minor >= requiredVersion.minor)
) {
  console.log('✅ Server version is compatible');
} else {
  console.log('⚠️  Please update your BlueBubbles server');
}
This endpoint is useful for debugging connection issues and verifying server capabilities before attempting to use advanced features.

Build docs developers (and LLMs) love