# @types/sns-validator

> TypeScript definitions for sns-validator

Latest version **0.3.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/sns-validator
pnpm add @types/sns-validator
yarn add @types/sns-validator
bun add @types/sns-validator
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2023-11-07 |
| First published | 2019-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51450 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/sns-validator
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sns-validator
- npm.io page: https://npm.io/package/@types/sns-validator

## Recent versions

- 0.3.3 (latest) — 2023-11-07
- 0.3.1 (ts3.7) — 2021-09-21
- 0.3.0 (ts2.2) — 2019-02-28
- 0.3.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/sns-validator`

# Summary
This package contains type definitions for sns-validator (https://github.com/aws/aws-js-sns-message-validator#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sns-validator.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sns-validator/index.d.ts)
````ts
declare class MessageValidator {
    /**
     * Create a new MessageValidator
     * @param hostPattern - A pattern used to validate that a message's certificate originates from a trusted domain. Default: `/^sns\.[a-zA-Z0-9\-]{3,}\.amazonaws\.com(\.cn)?$/`
     * @param encoding - The encoding of the messages being signed. Default is `utf8`
     */
    constructor(hostPattern?: RegExp, encoding?: string);

    /**
     * Validates a message's signature and passes it to the provided callback.
     * @param hash Can be the raw or parsed message.
     * @param cb The callback which is called with the message when it is valid or with an Error when it isn't.
     */
    validate(
        hash: string | Record<string, unknown>,
        cb: (err: Error | null, message?: Record<string, unknown>) => void,
    ): void;
}
export = MessageValidator;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Kévin Baumeyer](https://github.com/kevin68).

---
_Source: https://npm.io/package/@types/sns-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
