PHPackages                             samlitowitz/php-new-relic-event-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. samlitowitz/php-new-relic-event-api-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

samlitowitz/php-new-relic-event-api-client
==========================================

PHP Client for the New Relic Event API

v1.0.1(3y ago)2131Apache-2.0PHPPHP &gt;=7.2

Since Aug 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/samlitowitz/php-new-relic-event-api-client)[ Packagist](https://packagist.org/packages/samlitowitz/php-new-relic-event-api-client)[ RSS](/packages/samlitowitz-php-new-relic-event-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

PHP New Relic Event API Client
==============================

[](#php-new-relic-event-api-client)

Table of Contents
-----------------

[](#table-of-contents)

1. [Introduction](#introduction)
2. [Installation](#installation)
3. [Usage](#usage)
4. [References](#references)

Introduction
------------

[](#introduction)

This library introduces an [interface](src/EventAPI/Client.php) and an [implementation](src/EventAPI/Http/Client.php) to interact with the [New Relic Event API](https://docs.newrelic.com/docs/data-apis/ingest-apis/event-api/introduction-event-api).

### Interface

[](#interface)

The interface is provided to allow drop-in replacement and composition.

```
interface Client {
	public function send(PhpNewRelic\CustomEventCollection $customEvents): PhpNewRelic\EventAPI\Http\Response;
}
```

### Implementation

[](#implementation)

The only validation done client size is to ensure the payload is below the maximum allowed size. Parsing errors will be handled by New Relic as described in the [documentation](https://docs.newrelic.com/docs/data-apis/ingest-apis/event-api/introduction-event-api/#errors-parsing).

The client defaults to using the Guzzle HTTP client with a timeout of 12 seconds, however the constructor accepts anything which implements the `Psr\Http\Client\ClientInterface` interface.

Installation
------------

[](#installation)

```
composer require samlitowitz/php-new-relic-event-api-client
```

Usage
-----

[](#usage)

```
