# giphy-js-sdk-analytics

> The **Giphy Core SDK** is a wrapper around [Giphy Pingbacks API](https://giphypedia.atlassian.net/wiki/spaces/SEARCH/pages/41975810/User+Session+Tracking).

Latest version **1.0.1** (published 2018-06-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install giphy-js-sdk-analytics
pnpm add giphy-js-sdk-analytics
yarn add giphy-js-sdk-analytics
bun add giphy-js-sdk-analytics
```

## 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 | 1.0.1 |
| Published | 2018-06-13 |
| First published | 2018-06-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 25.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cosmo Cochrane |
| Maintainers | giphy |

## Links

- npm: https://www.npmjs.com/package/giphy-js-sdk-analytics
- npm.io page: https://npm.io/package/giphy-js-sdk-analytics

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [promise](https://npm.io/package/promise.md) ^7.1.1
- [unfetch](https://npm.io/package/unfetch.md) ^3.0.0
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.1.0
- [xmlhttprequest](https://npm.io/package/xmlhttprequest.md) ^1.8.0
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1

## Recent versions

- 1.0.1 (latest) — 2018-06-13
- 1.0.11 (beta) — 2018-08-06
- 1.0.10 — 2018-08-02
- 1.0.9 — 2018-08-02
- 1.0.8 — 2018-07-26
- 1.0.7 — 2018-07-26
- 1.0.6 — 2018-07-26
- 1.0.5 — 2018-07-20
- 1.0.4 — 2018-07-20
- 1.0.3 — 2018-07-19
- 1.0.2 — 2018-07-19
- 1.0.0 — 2018-06-13

## README

# Giphy Analytics Javascript SDK

The **Giphy Core SDK** is a wrapper around [Giphy Pingbacks API](https://giphypedia.atlassian.net/wiki/spaces/SEARCH/pages/41975810/User+Session+Tracking).

![Build Status](https://travis-ci.com/Giphy/giphy-web-sdk-core.svg?token=ytpQbMSuy8sydsqZwbwp&branch=master&style=flat-square) [![npm version](https://badge.fury.io/js/giphy-js-sdk-core.svg)](https://badge.fury.io/js/giphy-js-sdk-core) [![Downloads][downloads-image]][downloads-url]

[license-url]: LICENSE.md
[downloads-image]: https://img.shields.io/npm/dm/giphycore.svg?style=flat-square
[downloads-url]: http://npm-stat.com/charts.html?package=giphy-js-sdk-core
[version-svg]: https://img.shields.io/npm/v/giphycore.svg?style=flat-square
[package-url]: https://npmjs.org/package/giphy-js-sdk-core

# Getting Started

### Supported Methods

-   [Pingback Events](#pingback-events)

# Setup

### Require Module

npm

```shell
npm install --save giphy-js-sdk-core
```

### Initialize Giphy SDK

```javascript
var GphAnalytics = require('giphy-js-sdk-analytics')
client = GphAnalytics('YOUR_API_KEY')
```

### Pingback Events

Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored.
<br>
<br>

_Required Params_

-   "endpoint" - string - term that matches the api endpoint used to collect the gifs used available arguments are: 'search', 'trending', 'related' or 'reactions'

-   "gifId" - string - the gifId that is returned by the GIPHY API available inside any gif object

-   "userId" - string - A user's unique identifier (This is specific to your application and is not returned in any way by GIPHY)

-   "responseId" - string - The unique identifier for any given GIPHY API response, available as response_id in the GIPHY API response

```javascript
/// Analytics Events

client.onSeen(endpoint, gifId, userId, responseId)
client.onClick('search', 'u4styZNRWqR0Y', '1234', 'e1237saj412')
client.onHover('search', 'u4styZNRWqR0Y', '1234', 'e1237saj412')
```

# CONTRIBUTING

Managing git repositories can be hard, so we've laid out a few simple guidelines to help keep things organized.

## Guidelines

1.  Create a **Pull Request**; instead of pushing directly to `master`.

2.  Give your branch a **descriptive name** like `dh-network-fix` instead of something ambiguous like `my-branch`.

3.  Write a **descriptive summary** in the comment section on Github.

4.  **Don't merge your own Pull Request**; send it to your teammate for review.

5.  If you think something could be improved: **write a comment on the Pull Request** and send it to the author.

6.  Make sure your branch is based off `master`, and not some other outdated branch.

7.  **Don't reuse branches.** Once they're merged to `master` you should consider deleting them.

8.  Prefer **squash** when doing a **Pull Request**, as it simplifies the commit history.

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