Registry / messaging / aws-sqs-push

aws-sqs-push

JSON →
library3.0.3jsnpmunverified

A lightweight Node.js wrapper (v3.0.3) around the AWS SQS SDK that simplifies sending messages to FIFO queues by automatically retrieving the queue URL from the queue name. Supports cross-account queue access via AWS account ID. Ships TypeScript definitions. Requires Node >=8 and peer dependency aws-sdk ^2.580.0. Last published in 2020; maintenance-focused release cadence.

npm install aws-sqs-push
INSTALL
IMPORT
SIG · AWS-SQS-PUSH
A
aws-sqs-push
messagingjavascriptv3.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (sqsPush)
import sqsPush from 'aws-sqs-push';
const sqsPush = require('aws-sqs-push');
Package is ESM-first with TypeScript support; CommonJS require still works but not recommended. Use named import from v3.
sqsPush function
import { sqsPush } from 'aws-sqs-push';
import sqsPush from 'aws-sqs-push';
Both default and named exports exist; inspect type declarations if unsure.
SqsPushOptions type
import { SqsPushOptions } from 'aws-sqs-push';
Type import for TypeScript projects; available since v3.

Sends a JSON message to a FIFO SQS queue using queue name, with automatic URL resolution and optional cross-account ID.

import sqsPush from 'aws-sqs-push'; const queueName = 'my-queue.fifo'; const request = { MessageBody: JSON.stringify({ foo: 'bar' }), MessageGroupId: 'group1', MessageDeduplicationId: 'dedup-id-1' }; sqsPush(queueName, request, '123456789012') .then(response => { console.log('Message sent:', response.MessageId); }) .catch(err => { console.error('Failed to send message:', err); });
Debug
Known issues
breakingIn v3.0.0, the default export changed from a factory function to the push function directly. Requires update if using old default import pattern.
fix
Update import to `import sqsPush from 'aws-sqs-push'` and use as function directly.
affects: <3.0.0
deprecatedThe package has not been updated since 2020 and may have unresolved issues with newer AWS SDK versions (v3). Consider migrating to @aws-sdk/client-sqs.
fix
Replace with @aws-sdk/client-sqs: install `npm install @aws-sdk/client-sqs` and use `SQSClient` and `SendMessageCommand`.
affects: >=3.0.0
gotchaFIFO queues require MessageGroupId and MessageDeduplicationId. Omitting them causes 'MissingRequiredParameter' errors.
fix
Ensure request object includes both `MessageGroupId` and `MessageDeduplicationId` for FIFO queues.
affects: >=1.0.0
gotchaCross-account queue access requires proper IAM permissions on both accounts. aws-sqs-push does not verify permissions; errors may be opaque.
fix
Verify the target queue's policy allows `sqs:SendMessage` from your account. Use AWS SDK directly for debugging.
affects: >=1.0.0
Errors
Common errors & fixes
MissingRequiredParameter: Missing required key 'MessageBody' in params
The request object is missing the MessageBody field.
fix
Add `MessageBody: JSON.stringify({...})` to the request object.
InvalidParameterValue: Value <queue> for parameter QueueName is invalid. Must be an SQS queue URL or name.
The queue name does not exist or is incorrectly formatted (e.g., missing .fifo suffix for FIFO).
fix
Ensure the queue name is correct and includes '.fifo' if it's a FIFO queue.
AccessDenied: Access to the resource https://sqs.<region>.amazonaws.com/ is denied.
Missing or insufficient AWS credentials or IAM permissions.
fix
Verify AWS credentials via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) and ensure IAM policy allows sqs:GetQueueUrl and sqs:SendMessage.
Upgrade
Version history
3.0.3latest on npm
Audit
Dependencies
aws-sdkrequiredPeer dependency: core SDK for SQS operations (getQueueUrl, sendMessage)
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
2
Resources
aws-sqs-push — npm install aws-sqs-push · libregistry