Skip to main content

SQSAdapter

@h4ad/serverless-adapter > SQSAdapter

(class) SQSAdapter

The adapter to handle requests from AWS SQS.

The option of responseWithErrors is ignored by this adapter and we always call resolver.fail with the error.

Event Reference

Signature:

export declare class SQSAdapter extends AwsSimpleAdapter<SQSEvent> 

Extends: AwsSimpleAdapter <SQSEvent>

Example

const sqsForwardPath = '/your/route/sqs'; // default /sqs
const sqsForwardMethod = 'POST'; // default POST
const adapter = new SQSAdapter(\{ sqsForwardPath, sqsForwardMethod });

(constructor)

Default constructor

Signature:

constructor(options?: SQSAdapterOptions);

Parameters

ParameterTypeDescription
optionsSQSAdapterOptions(Optional) The options to customize the SNSAdapter

(method) canHandle

Signature:

canHandle(event: unknown): event is SQSEvent;

Parameters

ParameterTypeDescription
eventunknown

Returns:

event is SQSEvent

(method) getAdapterName

Signature:

getAdapterName(): string;

Returns:

string