# appsync-client

> A lightweight Appsync client that signs requests for you - designed to be run server-side (e.g. on Lambdas).

Latest version **2.16.0** (published 2023-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install appsync-client
pnpm add appsync-client
yarn add appsync-client
bun add appsync-client
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.16.0 |
| Published | 2023-01-09 |
| First published | 2020-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 60.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Maintainers | alan-cooney |
| Keywords | appsync, graphql, client, aws, server, server-side, lambda, lightweight, signature 4, sig4, signed |

## Links

- npm: https://www.npmjs.com/package/appsync-client
- Repository: https://github.com/skyhookadventure/appsync-client
- Homepage: https://github.com/skyhookadventure/appsync-client#readme
- Issues: https://github.com/skyhookadventure/appsync-client/issues
- npm.io page: https://npm.io/package/appsync-client

## Dependencies (3)

- [aws4](https://npm.io/package/aws4.md) ^1.11.0
- [graphql](https://npm.io/package/graphql.md) ^15.4.0
- [fake-tag](https://npm.io/package/fake-tag.md) ^2.0.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.16.0 (latest) — 2023-01-09
- 2.15.0 — 2022-07-17
- 2.14.0 — 2022-07-15
- 2.13.0 — 2022-05-05
- 2.12.0 — 2022-05-05
- 2.11.0 — 2021-11-08
- 2.10.0 — 2021-10-01
- 2.9.0 — 2021-08-18
- 2.8.0 — 2021-07-22
- 2.7.0 — 2021-06-16
- 2.6.0 — 2021-01-12
- 2.5.0 — 2021-01-12
- 2.4.0 — 2021-01-12
- 2.3.0 — 2021-01-12
- 2.2.0 — 2020-12-18
- … 10 more at https://npm.io/package/appsync-client/versions

## README

# Appsync Client

[![Built with
typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)](https://www.typescriptlang.org/)
[![version](https://badgen.net/npm/v/appsync-client)](https://www.npmjs.com/package/appsync-client)
![dependants](https://badgen.net/npm/dependents/appsync-client) ![license](https://badgen.net/npm/license/appsync-client)

A lightweight Appsync client that signs requests for you (using IAM permissions) - perfect for running on Lambdas or servers.

Queries are made using
[TypedDocumentNode](https://github.com/dotansimha/graphql-typed-document-node)
which means that the variables and results will be automatically typed for you
if using Typescript.

## Use

```typescript
import AppsyncClient from "appsync-client";

async function getTodo() {

    // Create a client
    const client = new AppsyncClient({
        // Required
        apiUrl: "https://xxx.appsync-api.xx-xxxx-x.amazonaws.com/graphql",
        // Optional - these will default to process.env values (e.g. the IAM
        // role of the Lambda)
        accessKeyId: "",
        secretAccessKey: "",
        sessionToken: ""
    });

    // Query for Todos
    const res = await client.request({
        // The typed document node query
        query: TypedDocumentNodeQuery,
        // Variables to replace (here we are replacing $id with "todoId")
        variables: {
            id: "todoId"
        }
    );
}
```

## Checklist

| CD Feature | Provided                     |
| ---------- | ---------------------------- |
| ✅         | Typescript                   |
| ✅         | Linting (AirBnB + Prettier)  |
| ✅         | Unit tests (Jest)            |
| ✅         | 100% test coverage           |
| ✅         | Github Continuous Deployment |

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