***

title: hasApiKeyAuth
slug: /reference/typescript/agents/configuration/auth-handler/has-api-key-auth
description: Check whether API key authentication is configured.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Check whether API key authentication is configured on this handler.

## **Parameters**

None.

## **Returns**

`boolean` -- `true` if an API key has been set.

## **Example**

```typescript {7}
import { AuthHandler } from '@signalwire/sdk';

const auth = new AuthHandler({
  apiKey: 'my-api-key',
});

console.log(auth.hasApiKeyAuth()); // true
```