Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Get SDK version

Retrieve the OpenIMClientSDK version bundled inside the current HarmonyOS HAR package.

Copy

After completing Environment-specific implementation and adding the HAR package, call version() to inspect the runtime version of the embedded OpenIMClientSDK core. This is useful for diagnostics, startup telemetry, and platform compatibility checks.

Code example

import sdk, { VersionResp } from '@openimsdk/imsdk';

const response: VersionResp = await sdk.version();
console.info(`OpenIMClientSDK version: ${response.version}`);

Return value

Returns a Promise that resolves to a VersionResp object:

PropertyTypeDescription
versionstringThe underlying OpenIMClientSDK semantic version string.

Use this value to verify that the loaded binary matches expectations. Do not substitute this version string for your application's product version or use it as a server authentication credential.

If multiple components require version information, cache the result at the application layer rather than re-querying the SDK during view rendering. Once your environment is verified, proceed to Authenticate and manage session.