> ## Documentation Index > Fetch the complete documentation index at: https://www.canva.dev/docs/apps/llms.txt > Use this file to discover all available pages before exploring further. # tokenExtractors API reference for the tokenExtractors method. NOTE: **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 Extracts a JWT token from the Authorization header using the Bearer scheme. **Returns** A token extractor function. (`req`) => `Promise | string` **Example** ```typescript import { user, tokenExtractors } from "@canva/app-middleware/express"; app.use( "/api", user.verifyToken({ appId: APP_ID, tokenExtractor: tokenExtractors.fromBearerAuth(), }), ); ``` Extracts a JWT token from a query string parameter. **Parameters** The name of the query parameter **Returns** A token extractor function. (`req`) => `Promise | string` **Example** ```typescript import { user, tokenExtractors } from "@canva/app-middleware/express"; app.use( "/api", user.verifyToken({ appId: APP_ID, tokenExtractor: tokenExtractors.fromQuery("canva_token"), }), ); ``` Extracts a JWT token from a cookie. Requires cookie-parser middleware or similar to parse cookies. **Parameters** The name of the cookie **Returns** A token extractor function. (`req`) => `Promise | string` **Example** ```ts import cookieParser from "cookie-parser"; import { user, tokenExtractors } from "@canva/app-middleware/express"; app.use(cookieParser()); app.use( "/api", user.verifyToken({ appId: APP_ID, tokenExtractor: tokenExtractors.fromCookie("canva_token"), }), ); ```