npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edd-kernel/provider-aws-sns-sqs

v0.2.0-alpha.1

Published

AWS SNS + SQS EDD Kernel provider.

Readme

@edd-kernel/provider-aws-sns-sqs

AWS SNS + SQS provider for EDD Kernel: publishes to an SNS topic and consumes from the SQS queue subscribed to it.

Consuming is @edd-kernel/provider-aws-sqs's own code, inherited rather than copied, so this package depends on it. What this package adds is the topic, the subscription and the queue policy that lets the topic deliver.

Repository: brunnofoggia/edd-kernel-js

Install

npm install @edd-kernel/contracts @edd-kernel/provider-aws-sns-sqs

For provider-name based client creation, install @edd-kernel/factory in place of the contract. It brings the contract and re-exports it:

npm install @edd-kernel/factory @edd-kernel/provider-aws-sns-sqs

Usage

import { createSnsSqsClient } from '@edd-kernel/provider-aws-sns-sqs';

const client = createSnsSqsClient({ createIfNotExists: true }, { region: 'us-east-1' });

await client.consume({ queueName: 'orders' }, async (event, context) => {
    console.log(event);
    await context.ack();
});

await client.send({ topicName: 'orders' }, { type: 'OrderPlaced', payload: {} });

Through @edd-kernel/factory:

import { EddProviderName, createEddClient } from '@edd-kernel/factory';

const client = await createEddClient({
    providerName: EddProviderName.AwsSnsSqs,
    createIfNotExists: true,
    options: { region: 'us-east-1' },
});

The package also exports SnsSqsEddClient for direct construction and inheritance. Its static provider identity is aws-sns-sqs.

Addressing

| Sends to | Meaning | | --------------- | ---------------------------------------------------------- | | { topicName } | A logical name, joined with env, project and prefix. | | { topicArn } | A topic ARN written in full, used as it is. |

| Consumes from | Meaning | | --------------- | ------------------------------------------- | | { queueName } | A logical name, as aws-sqs resolves it. | | { queueUrl } | A queue URL written in full, used as it is. |

Any other address is refused by the compiler, and at runtime with EddKernelConfigurationError.

SNS has no lookup by name, so a topicName reaches its ARN in one of two ways:

  • with createIfNotExists: true, through CreateTopic, which returns the ARN of a topic that already exists;
  • with createIfNotExists: false, composed from region, accountId and the resolved name, so a publish-only role never needs sns:CreateTopic. Without both options, pass a topicArn.

A topic that does not exist fails the publish as EddTargetNotFoundError.

Provisioning

With createIfNotExists: true, consume finishes the queue before it returns: it creates the queue and the topic when missing, lets the topic send to the queue, and subscribes the queue to the topic.

  • Which topic. The queue's binding, and failing that the queue's own name. Both sides of a binding are logical names, scoped with the same options as the queue. A queue addressed by queueUrl is never provisioned: a URL has no logical name to look a binding up by. One already subscribed is consumed as usual.
  • The queue policy. One statement is added allowing sns.amazonaws.com to call sqs:SendMessage when aws:SourceArn is the topic's ARN. An equivalent statement already in the policy is left as it is, and statements for other principals survive. The policy is read again after the write, and a statement that does not show up is reported as EddProviderError instead of leaving a subscription that delivers nothing.
  • Raw delivery. The subscription is created with RawMessageDelivery: "true", so the queue receives the same body aws-sqs would have sent.

This path needs sns:CreateTopic, sns:Subscribe, sqs:CreateQueue, sqs:GetQueueAttributes and sqs:SetQueueAttributes.

With createIfNotExists: false, nothing is provisioned. The subscription and the policy are yours, and they must:

  • let sns.amazonaws.com call sqs:SendMessage on the queue from the topic;
  • enable RawMessageDelivery on the subscription — without it, the handler receives the SNS notification envelope instead of the event.

createTopic(name) and createSubscription(queueName, { topicName }) do the same work on their own, and answer the topic ARN and the subscription ARN. createQueue is inherited from aws-sqs.

Provider Options

Everything aws-sqs takes configures the queue half unchanged — client, endpointUrl, clientOptions, queueUrlByName, createQueueAttributes, createQueueTags, waitTimeSeconds, pollIntervalMs, visibilityTimeout, nackVisibilityTimeout.

region, credentials and accountId are shared by both halves. The topic half adds:

  • snsClient: custom SNS-compatible client for tests or adapters.
  • snsEndpointUrl: SNS endpoint override, reaching the SDK as endpoint.
  • snsClientOptions: the rest of the AWS SNSClient configuration, merged over DEFAULT_SNS_CLIENT_CONFIG.
  • bindings: each topic and the queues subscribed to it, as { topic, queues } entries. A topic may appear in several entries; a queue bound to two topics is refused when the client is built.

DEFAULT_SNS_CLIENT_CONFIG sets a 5s connection timeout, a 10s request timeout, throwOnRequestTimeout: true and three attempts. mergeSnsClientConfig merges requestHandler field by field.

Lifecycle

Acknowledgement, polling and shutdown are aws-sqs's. The SNS and SQS clients the provider created are destroyed on close; injected clients are never destroyed.