SDKs

PHP SDK (server api)

Quickly integrate the Ours Privacy PHP SDK using Composer. Explore its features with our Interactive API Explorer.

Ours Privacy PHP SDK Documentation

This is a quick start guide for integrating the Ours Privacy PHP SDK into your server-side applications.

Installation

Install the SDK via Composer:

composer require oursprivacy/ingest-sdk

For more details, visit the packagist repository | Github Repo

Usage

Initialize the SDK and send events with just a few lines of code:

<?php
require 'vendor/autoload.php';

use OursPrivacy\Client;

$client = new Client();

// Track an event
$response = $client->track->event(
  token: 'your-api-key',
  event: 'Purchase',
  userId: 'user123'
);

// Identify a user
$response = $client->identify->visitor(
  token: 'your-api-key',
  userId: 'user123',
  userProperties: [
    'email' => 'user@example.com',
    'firstName' => 'John',
    'lastName' => 'Doe'
  ]
);

Explore the API

Want to see what the SDK can do? Try our Interactive API Explorer to experiment with endpoints and features in real time.

How is this guide?

On this page

Ours Privacy PHP SDK Documentation