DynamoDB EntityClient options. Extends BaseEntityClientOptions and DynamoDBClientConfig with the following additional properties:

  • [enableXray] - Activates AWS Xray for internal DynamoDb client when true and running in a Lambda environment.
  • entityManager - EntityManager instance.
  • tableName - Table name.
interface EntityClientOptions<C> {
    accountId?: string | Provider<string>;
    accountIdEndpointMode?: (AccountIdEndpointMode | Provider<AccountIdEndpointMode>) & (string | Provider<string>);
    apiVersion?: string;
    base64Decoder?: Decoder;
    base64Encoder?: Encoder;
    batchProcessOptions?: Omit<BatchProcessOptions<unknown, unknown>, "batchHandler" | "unprocessedItemExtractor">;
    bodyLengthChecker?: BodyLengthCalculator;
    cacheMiddleware?: boolean;
    credentialDefaultProvider?: ((input: any) => AwsCredentialIdentityProvider);
    credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
    customUserAgent?: string | UserAgent;
    defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
    defaultUserAgentProvider?: Provider<UserAgent>;
    disableHostPrefix?: boolean;
    enableXray?: boolean;
    endpoint?: (string | EndpointV2 | Endpoint | Provider<Endpoint> | Provider<EndpointV2>) & (string | EndpointV2 | Endpoint | Provider<...> | Provider<...> | Provider<...>);
    endpointCacheSize?: number;
    endpointDiscoveryEnabled?: boolean;
    endpointDiscoveryEnabledProvider?: Provider<undefined | boolean>;
    endpointProvider?: ((params: EndpointParameters, context?: {
        logger?: Logger;
    }) => EndpointV2);
    entityManager: EntityManager<C>;
    extensions?: RuntimeExtension[];
    httpAuthSchemeProvider?: DynamoDBHttpAuthSchemeProvider;
    httpAuthSchemes?: HttpAuthScheme[];
    logger?: Pick<Console, "error" | "debug">;
    maxAttempts?: number | Provider<number>;
    region?: string | Provider<string>;
    requestHandler?: (Record<string, unknown> | NodeHttpHandlerOptions | FetchHttpHandlerOptions | RequestHandler<any, any, HttpHandlerOptions>) & HttpHandlerUserInput;
    retryMode?: string | Provider<string>;
    retryStrategy?: RetryStrategy | RetryStrategyV2;
    runtime?: string;
    serviceConfiguredEndpoint?: undefined;
    serviceId?: string;
    sha256?: HashConstructor | ChecksumConstructor;
    signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
    signerConstructor?: (new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner);
    signingEscapePath?: boolean;
    signingRegion?: string;
    streamCollector?: StreamCollector;
    systemClockOffset?: number;
    tableName: string;
    tls?: boolean;
    urlParser?: UrlParser;
    useDualstackEndpoint?: boolean | Provider<boolean>;
    useFipsEndpoint?: boolean | Provider<boolean>;
    userAgentAppId?: string | Provider<undefined | string>;
    utf8Decoder?: Decoder;
    utf8Encoder?: Encoder;
}

Type Parameters

Hierarchy

Properties

accountId?: string | Provider<string>
accountIdEndpointMode?: (AccountIdEndpointMode | Provider<AccountIdEndpointMode>) & (string | Provider<string>)

Defines if the AWS AccountId will be used for endpoint routing.

apiVersion?: string

The API version set internally by the SDK, and is not planned to be used by customer code.

base64Decoder?: Decoder

The function that will be used to convert a base64-encoded string to a byte array.

base64Encoder?: Encoder

The function that will be used to convert binary data to a base64-encoded string.

batchProcessOptions?: Omit<BatchProcessOptions<unknown, unknown>, "batchHandler" | "unprocessedItemExtractor">

Default batch process options.

bodyLengthChecker?: BodyLengthCalculator

A function that can calculate the length of a request body.

cacheMiddleware?: boolean

Default false.

When true, the client will only resolve the middleware stack once per Command class. This means modifying the middlewareStack of the command or client after requests have been made will not be recognized.

Calling client.destroy() also clears this cache.

Enable this only if needing the additional time saved (0-1ms per request) and not needing middleware modifications between requests.

credentialDefaultProvider?: ((input: any) => AwsCredentialIdentityProvider)

Default credentials provider; Not available in browser runtime.

credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider

The credentials used to sign requests.

customUserAgent?: string | UserAgent

The custom user agent header that would be appended to default one

defaultsMode?: DefaultsMode | Provider<DefaultsMode>

The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK.

defaultUserAgentProvider?: Provider<UserAgent>

The provider populating default tracking information to be sent with user-agent, x-amz-user-agent header

disableHostPrefix?: boolean

Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation.

enableXray?: boolean

Activates AWS Xray for internal DynamoDb client when true and running in a Lambda environment.

endpoint?: (string | EndpointV2 | Endpoint | Provider<Endpoint> | Provider<EndpointV2>) & (string | EndpointV2 | Endpoint | Provider<...> | Provider<...> | Provider<...>)

The fully qualified endpoint of the webservice. This is only for using a custom endpoint (for example, when using a local version of S3).

Endpoint transformations such as S3 applying a bucket to the hostname are still applicable to this custom endpoint.

endpointCacheSize?: number

The size of the client cache storing endpoints from endpoint discovery operations. Defaults to 1000.

endpointDiscoveryEnabled?: boolean

Whether to call operations with endpoints given by service dynamically. Setting this config to true will enable endpoint discovery for all applicable operations. Setting it to false will explicitly disable endpoint discovery even though operations that require endpoint discovery will presumably fail. Leaving it to undefined means SDK only do endpoint discovery when it's required. Defaults to undefined.

endpointDiscoveryEnabledProvider?: Provider<undefined | boolean>

The provider which populates default for endpointDiscoveryEnabled configuration, if it's not passed during client creation.

endpointProvider?: ((params: EndpointParameters, context?: {
    logger?: Logger;
}) => EndpointV2)

Providing a custom endpointProvider will override built-in transformations of the endpoint such as S3 adding the bucket name to the hostname, since they are part of the default endpointProvider.

entityManager: EntityManager<C>

EntityManager instance.

extensions?: RuntimeExtension[]

Optional extensions

httpAuthSchemeProvider?: DynamoDBHttpAuthSchemeProvider

Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.

httpAuthSchemes?: HttpAuthScheme[]

Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.

logger?: Pick<Console, "error" | "debug">

Injected logger object. Must support debug and error methods. Default: console

maxAttempts?: number | Provider<number>

Value for how many times a request will be made at most in case of retry.

region?: string | Provider<string>

The AWS region to which this client will send requests

requestHandler?: (Record<string, unknown> | NodeHttpHandlerOptions | FetchHttpHandlerOptions | RequestHandler<any, any, HttpHandlerOptions>) & HttpHandlerUserInput

The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.

retryMode?: string | Provider<string>

Specifies which retry algorithm to use.

retryStrategy?: RetryStrategy | RetryStrategyV2

The strategy to retry the request. Using built-in exponential backoff strategy by default.

runtime?: string

The runtime environment.

serviceConfiguredEndpoint?: undefined

This field is used internally so you should not fill any value to this field.

serviceId?: string

Unique service identifier.

sha256?: HashConstructor | ChecksumConstructor

A constructor for a class implementing the @smithy/types#ChecksumConstructor interface that computes the SHA-256 HMAC or checksum of a string or binary buffer.

signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>)

The signer to use when signing requests.

signerConstructor?: (new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner)

The injectable SigV4-compatible signer class constructor. If not supplied, regular SignatureV4 constructor will be used.

signingEscapePath?: boolean

Whether to escape request path when signing the request.

signingRegion?: string

The region where you want to sign your request against. This can be different to the region in the endpoint.

streamCollector?: StreamCollector

A function that converts a stream into an array of bytes.

systemClockOffset?: number

An offset value in milliseconds to apply to all signing times.

tableName: string

Table name.

tls?: boolean

Whether TLS is enabled for requests.

urlParser?: UrlParser

The function that will be used to convert strings into HTTP endpoints.

useDualstackEndpoint?: boolean | Provider<boolean>

Enables IPv6/IPv4 dualstack endpoint.

useFipsEndpoint?: boolean | Provider<boolean>

Enables FIPS compatible endpoints.

userAgentAppId?: string | Provider<undefined | string>

The application ID used to identify the application.

utf8Decoder?: Decoder

The function that will be used to convert a UTF8-encoded string to a byte array.

utf8Encoder?: Encoder

The function that will be used to convert binary data to a UTF-8 encoded string.