API reference
Asset: Test
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddPageapplyTemplateautofillDesignbulkCreate.launchcreateRichtextRangeeditContentgetBrandKitColorsgetBrandTemplateMetadatagetCurrentPageContextgetCurrentPageMetadatagetDesignColorsgetDesignMetadatagetDesignTemplateMetadatagetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenpublish.launchrequestBrandTemplatesrequestDataFieldMatchingrequestExportselection.registerOnChangesetCurrentPageBackgroundsetDataFieldLabelVisibilityui.startDragToCursorui.startDragToPointChangelog
Design: Test
Intents
Intents: Asset
Intents: Content
Intents: Data
Intents: Design
Intents: Test
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrlChangelog
Platform: Test
User: Test
App middleware: Express
Error
Error: Test
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