---
schema_version: "1"
id: a83f9aa9e68634d196241756e9dafc74f4e98db679a014f5206337d74fcaf212
title: getAuthHeader | @tableau/taco-toolkit - v2.1.0
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/webdataconnector/reference/functions/app.getAuthHeader.md
canonical_url: https://help.tableau.com/current/api/webdataconnector/en-us/reference/functions/app.getAuthHeader.html
source_site: help.tableau.com
content_type: documentation
content_hash: 4d9cb08f93bf0ea980152f9071545cfb8e6d2e8473015388ddf2a477df6f9f7b
description: Documentation for @tableau/taco-toolkit
---
- [@tableau/taco-toolkit](https://help.tableau.com/current/api/webdataconnector/en-us/reference/index.html)
- [app](https://help.tableau.com/current/api/webdataconnector/en-us/reference/modules/app.html)
- [getAuthHeader](https://help.tableau.com/current/api/webdataconnector/en-us/reference/functions/app.getAuthHeader.html)

# Function getAuthHeader

- getAuthHeader(token, prefix?): [AuthHeader](https://help.tableau.com/current/api/webdataconnector/en-us/reference/types/app.AuthHeader.html)[](#getAuthHeader)
- Generates an authentication header using the provided token and optional prefix.
    
    #### Parameters
    
    - ##### token: string
        
        The token used for authentication.
    - ##### prefix: string = 'Bearer'
        
        The prefix to be added before the token (default is 'Bearer').
    
    #### Returns [AuthHeader](https://help.tableau.com/current/api/webdataconnector/en-us/reference/types/app.AuthHeader.html)
    
    The authentication header.
    
    #### Example
    
    ```
    //Generating a custom prefix token headerconst token = 'your-custom-token';const customPrefix = 'Custom';const header = getAuthHeader(token, customPrefix);// header will be: { Authorization: 'Custom your-custom-token' }
    ```

### Settings

#### Member Visibility

- Inherited

#### Theme

OSLightDark

Generated using [TypeDoc](https://typedoc.org/)