API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignMetadatagetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDrag
Intents: data
Intents: design
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrl
addAudioTrack
API reference for the addAudioTrack method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Adds an audio track to the user's design.
Usage: Add audio track to design
import { addAudioTrack } from "@canva/design";import type { AudioTrack } from "@canva/design";import type { AudioRef } from "@canva/asset";const exampleAudioRef = "YOUR_AUDIO_REF" as AudioRef;const audioTrack: AudioTrack = {ref: exampleAudioRef};await addAudioTrack(audioTrack);
TYPESCRIPT
Parameters
audioTrack
AudioTrack
Required
The audio track to add to the user's design.
ref
AudioRef
Required
A unique identifier that points to an audio asset in Canva's backend.
Returns
Promise<void>