shapintv / customerio

A PHP SDK for customer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CustomerIO PHP SDK

latest version total downloads

Install

Via Composer

$ composer require shapintv/customerio

Usage

// Create HTTP Clients
$behavioralTrackingClient = HttpClient::create([
    'base_uri' => 'https://track.customer.io/api/v1/',
    'auth_basic' => [self::SITE_ID, self::API_KEY],
    'headers' => [
        'Content-Type' => 'application/json',
    ],
]);

$apiClient = HttpClient::create([
    'base_uri' => 'https://api.customer.io/v1/api/',
    'auth_basic' => [self::SITE_ID, self::API_KEY],
    'headers' => [
        'Content-Type' => 'application/json',
    ],
]);

$apiClient = new CustomerIOClient($behavioralTrackingClient, $apiClient);

// Create a customer
$apiClient->customers()->createOrUpdate('my_custom_id', [
    'email' => 'georges@abitbol.com',
]);

License

The MIT License (MIT). Please see License File for more information.

About

A PHP SDK for customer.io

License:MIT License


Languages

Language:PHP 94.9%Language:Makefile 5.1%