# serverless-plugin-api-gateway-integrations

> Serverless plugin to add API Gateway integrations

Latest version **0.0.8** (published 2019-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install serverless-plugin-api-gateway-integrations
pnpm add serverless-plugin-api-gateway-integrations
yarn add serverless-plugin-api-gateway-integrations
bun add serverless-plugin-api-gateway-integrations
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2019-08-05 |
| First published | 2019-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Erez Rokah |
| Maintainers | erezro |
| Keywords | serverless, serverless framework, serverless applications, serverless modules, api gateway, integrations, aws, aws lambda, amazon, amazon web services, sqs |

## Links

- npm: https://www.npmjs.com/package/serverless-plugin-api-gateway-integrations
- npm.io page: https://npm.io/package/serverless-plugin-api-gateway-integrations

## Dependencies (1)

- [change-case](https://npm.io/package/change-case.md) ^3.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2019-08-05
- 0.0.7 — 2019-07-28
- 0.0.5 — 2019-07-22
- 0.0.4 — 2019-07-22
- 0.0.3 — 2019-07-22
- 0.0.2 — 2019-07-21
- 0.0.1 — 2019-07-21

## README

# serverless-plugin-api-gateway-integrations

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CircleCI](https://circleci.com/gh/erezrokah/serverless-plugin-api-gateway-integrations.svg?style=svg)](https://circleci.com/gh/erezrokah/serverless-plugin-api-gateway-integrations)

> Note: If you're missing any capability please open an issue/feature request :)

## Introduction

I wrote this plugin since I wanted to wrap my lambda with an SQS queue.<br/>
I found that there is a lot of boilerplate when writing SQS API Gateway integration hence this plugin.<br/>
I'm open to adding more integrations and configuration options :)

## Installation

Install with [yarn](https://github.com/yarnpkg/yarn)

```bash
yarn add serverless-plugin-api-gateway-integrations --dev
```

or [npm](https://www.npmjs.com/)

```bash
npm install serverless-plugin-api-gateway-integrations --save-dev
```

## Usage

In your `serverless.yml` under `plugins` add

```yaml
plugins:
  - serverless-plugin-api-gateway-integrations
```

Under `custom` add:

```yaml
custom:
  apiGatewayIntegrations:
    - { type: sqs, name: 'queue' } # only sqs is supported at the moment
```

You can reference the created queues' ARNs by using Pascal case naming:

```yaml
functions:
  consumer:
    events:
      - sqs:
          arn: !GetAtt ApiGatewayIntegrationSqsQueue.Arn

  errorHandler:
    events:
      - sqs:
          arn: !GetAtt ApiGatewayIntegrationSqsQueueDlq.Arn
```

The plugin will create an API gateway (or use the existing default one if exists), and add all the necessary resources, methods and roles (with cors support).

Then you can do:

```bash
curl -d '{"message":"Hello World!"}' -H "Content-Type: application/json" -X POST https://*************.execute-api.us-east-1.amazonaws.com/dev/queue
```

---
_Source: https://npm.io/package/serverless-plugin-api-gateway-integrations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
