@fgiova/mini-sns-client
v2.0.0
Published
[](https://www.npmjs.com/package/@fgiova/mini-sns-client)  [
Requirements
Node.js ^22.14.0 || >= 24.10.0
Installation
npm install @fgiova/mini-sns-clientUsage
import {MiniSNSClient} from '@fgiova/mini-sns-client'
const client = new MiniSNSClient("eu-central-1");
await client.publishMessage({
TopicArn: "arn:aws:sns:eu-central-1:000000000000:test",
Message: "Hello World!",
MessageAttributes: {
"my-attribute": {
DataType: "String",
StringValue: "my-value"
}
}
});
await client.publishMessageBatch({
TopicArn: "arn:aws:sns:eu-central-1:000000000000:test",
PublishBatchRequestEntries: [
{
Id: "31afb534-e25e-5812-a92f-e8ff0921f9dd",
Message: "Hello World!",
MessageAttributes: {
"my-attribute": {
DataType: "String",
StringValue: "my-value"
}
}
},
{
Id: "85565b18-6ad4-5ba5-89b2-06d381ab1a6a",
Message: "Hello World! Again",
}
]
});
API
MiniSNSClient(region: string, endpoint?: string, undiciOptions?: Pool.Options, signer?: Signer | SignerOptions)
MiniSNSClient.publishMessage(message: PublishMessage): Promise<PublishResponse>
MiniSNSClient.publishMessageBatch(messages: PublishBatchMessage): Promise<PublishBatchResponse>
MiniSNSClient.destroy(signer?: boolean): Promise<[void, boolean | void]> // signer destroy default trueAll types are defined in schemas.ts and are derived from the AWS SNS API The main difference is that batch operations are not limited to 10 items, but accept any number of items and provide for running the batches needed to exhaust the total number of items.
License
Licensed under MIT.
