On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

features.registerOnSupportChange

API reference for the features.registerOnSupportChange method.

Registers a callback that runs when the context changes and an SDK method becomes supported or unsupported.

Usage: Monitoring feature support changes

import { features } from '@canva/platform';
import { addElementAtPoint } from '@canva/design';
const supportDisposer = features.registerOnSupportChange(() => {
const isNowSupported = features.isSupported(addElementAtPoint);
// Update UI based on new support status
});
// Later: cleanup the listener
await supportDisposer();
TYPESCRIPT

Parameters

onSupportChangefunction
Required

The callback that runs when the support status of an SDK method changes.

Returns

void

Returns

Disposes an event listener.

() => void