API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddPagebulkCreate.launchcreateRichtextRangeeditContentgetCurrentPageContextgetDesignMetadatagetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenpublish.launchrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPoint
Intents: Asset
Intents: Content
Intents: data
Intents: design
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrl
App middleware
App middleware: Express
tokenExtractors
API reference for the tokenExtractors method.
This 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.
Factory functions for extracting JWT tokens from various sources.
Use these with the tokenExtractor option in user.verifyToken().
Methods
fromBearerAuthfunctionRequired
Extracts a JWT token from the Authorization header using the Bearer scheme.
Returns
A token extractor function.
(req) => Promise<string> | string
Example
import { user, tokenExtractors } from "@canva/app-middleware/express";app.use("/api",user.verifyToken({appId: APP_ID,tokenExtractor: tokenExtractors.fromBearerAuth(),}),);
TYPESCRIPT
fromQueryfunctionRequired
Extracts a JWT token from a query string parameter.
Parameters
paramNamestringRequired
The name of the query parameter
Returns
A token extractor function.
(req) => Promise<string> | string
Example
import { user, tokenExtractors } from "@canva/app-middleware/express";app.use("/api",user.verifyToken({appId: APP_ID,tokenExtractor: tokenExtractors.fromQuery("canva_token"),}),);
TYPESCRIPT