Skip to content

System API ​

System information, runtime environment, and API discovery.

System API ​

system.getApiStats ​

Count the registered methods, overall and per namespace, and the registered plugins.

This method takes no parameters.

Returns

FieldTypeDescription
totalApisintegerNumber of registered methods.
internalApisintegerNumber of built-in methods.
externalApisintegerNumber of methods registered by external plugins.
pluginCountintegerNumber of registered external plugins.
byNamespaceRecord<string, integer>Method count per namespace.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('system.getApiStats');

system.getApisByNamespace ​

List the registered methods of one namespace; an unknown namespace lists nothing.

ParameterTypeRequiredDescription
namespacestringYesNamespace to list, such as playback. Must not be empty.

Returns

FieldTypeDescription
apisSystemApiInfo[]The namespace's methods, in the order of system.listAvailableApis; empty for an unknown namespace.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const apis = await fb2k.invoke('system.getApisByNamespace', { namespace: 'playback' });

system.getDPI ​

Report the DPI of the display showing the calling window; the main window's when the caller cannot be resolved.

This method takes no parameters.

Returns

FieldTypeDescription
dpiintegerDPI of the display; 96 when no window can be resolved.
scalenumberdpi / 96.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('system.getDPI');

system.getLocale ​

Report the Windows user locale with its localized language and country names.

This method takes no parameters.

Returns

FieldTypeDescription
localestringLocale tag such as en-US, the default when Windows reports none.
languagestringLocalized language name; empty when unavailable.
countrystringLocalized country or region name; empty when unavailable.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('system.getLocale');

system.getRegisteredPlugins ​

List the external plugins that registered methods with the bridge.

This method takes no parameters.

Returns

FieldTypeDescription
pluginsSystemPluginInfo[]The plugins.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('system.getRegisteredPlugins');

system.getTheme ​

Report the Windows personalization settings: app theme, accent color and transparency.

This method takes no parameters.

Returns

FieldTypeDescription
darkModebooleantrue when Windows uses the dark app theme.
isDarkbooleanSame as darkMode; kept for callers that read this name.
accentColorstringAccent color as #RRGGBB; #0078D4 when DWM cannot report one.
transparencybooleanWhether transparency effects are enabled.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('system.getTheme');

system.isPluginRegistered ​

Report whether an external plugin owns the namespace.

ParameterTypeRequiredDescription
namespacestringYesNamespace to look up. Must not be empty.

Returns

FieldTypeDescription
registeredbooleanWhether an external plugin owns the namespace.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const res = await fb2k.invoke('system.isPluginRegistered', { namespace: 'myplugin' });
if (res.success === false) throw new Error(res.error);
const { registered } = res;

system.listAvailableApis ​

List the methods the bridge currently accepts, built-in ones and those registered by external plugins.

ParameterTypeRequiredDescription
includeInternalbooleanNoInclude built-in methods. Default: true.
includeExternalbooleanNoInclude methods registered by external plugins. Default: true.

Returns

FieldTypeDescription
apisSystemApiInfo[]The methods, sorted by fullName in ascending byte order.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const apis = await fb2k.invoke('system.listAvailableApis', { includeExternal: false });

system.searchApis ​

Find methods whose full name or description contains query, ignoring case.

ParameterTypeRequiredDescription
querystringYesText to look for in full names and descriptions. Must not be empty.

Returns

FieldTypeDescription
apisSystemApiInfo[]The matching methods, in the order of system.listAvailableApis.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const apis = await fb2k.invoke('system.searchApis', { query: 'playlist' });

Owner-family behavior and limits ​

  • system.* reports registered runtime information, external plugin status, and Windows system environment settings.