The PHP SDK we provide and support makes it easy for you to interface with our API or integrate into your custom system if you’re using PHP as your primary language.

Installation

Install via Composer

Install with composer using composer require bananastandio/php_sdk. This is the fastest and recommended way to do it.

Install Manually

If you’re not using composer then you can copy the folder to your project and include all files in the repo.

That’s it!

Usage

Setup

require_once('vendor/autoload.php');

use Banana\Client;
use Banana\Models\Event;

$client = new Client("*your public key*", "* your secret key *"); // Replace with your keys

Fetch events

$events = $client->events(); // Get the first page of events (default sorting is most recently updated first)
foreach ($events as $event) {
    echo $event->id . "|" . $event->visitor_id . "\n";
}

Delete an Event

$event->delete();

Find event

$event = Event::find($client, $events[0]->id);
echo "Found: " . $event->id . "|" . $event->visitor_id . "\n";

Get HTML Content for a Product

$html = $client->getProductPageHtml($event->product_id);

Push view event for that product for customer 123

$client->pushViewEvent($event->product_id, null, 123);

Github Rep

If you want to contribute or fork work on the Banana Stand php sdk, then you can do so at the github repo.

https://www.github.com/bananastandio/php_sdk