# ChannelNamespaceProps

Additional property for an AppSync channel namespace for an Event API reference.

Extends: ChannelNamespaceProps
Extends: BaseChannelNamespaceProps
Used as props by: ChannelNamespace

- Source: [`aws-appsync/lib/channel-namespace.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/channel-namespace.ts#L132)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

```ts
declare const api: appsync.EventApi;

new appsync.ChannelNamespace(this, 'Namespace', {
  api,
  authorizationConfig: {
    // Override publishing authorization to API Key
    publishAuthModeTypes: [appsync.AppSyncAuthorizationType.API_KEY],
    // Override subscribing authorization to Lambda
    subscribeAuthModeTypes: [appsync.AppSyncAuthorizationType.LAMBDA],
  },
});
```

## Properties

- `api`: [IEventApi](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.IEventApi.html) (required) — The API this channel namespace is associated with.

- `authorizationConfig`: [NamespaceAuthConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.NamespaceAuthConfig.html) — Authorization config for channel namespace.

  **Default:** defaults to Event API default auth config

- `channelNamespaceName`: string — the name of the channel namespace.

  **Default:** the construct's id will be used

- `code`: [Code](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.Code.html) — The Event Handler code.

  **Default:** no code is used

- `publishHandlerConfig`: [HandlerConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.HandlerConfig.html) — onPublish handler config.

  **Default:** no handler config

- `subscribeHandlerConfig`: [HandlerConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.HandlerConfig.html) — onSubscribe handler config.

  **Default:** no handler config
