Skip to content

requireApiVersion

Official

Returns true if the API version is equal or higher than the requested version. Use this to limit export functionality that require specific API versions to avoid crashing on older Obsidian builds.

Import:

import { requireApiVersion } from 'obsidian';

Example:

console.log(requireApiVersion('1.8.9')); // true

Signature:

function requireApiVersion(version: string): boolean

Parameters:

ParameterTypeDescription
versionstringThe version to check against.

Returns: booleantrue if the API version is equal or higher than the requested version.

Example:

console.log(requireApiVersion('1.8.9')); // true