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';

Signature:

function requireApiVersion(version: string): boolean

Parameters:

Parameter Type Description
version string The version to check against.

Returns: boolean — true if the API version is equal or higher than the requested version.

Example:

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