Talaria

Docs / SDKs / PHP

PHP SDK

Official Composer package for PHP apps — capture exceptions and structured logs.

Building on Silverstripe CMS? Use the Silverstripe framework guide for Injector and Monolog wiring.

Install

bash
composer require talaria/sdk

Configure

Use a project API key (tal_live_…). Never commit keys; load from environment.

talaria.phpphp
use Talaria\Client;

$client = Client::create([
    'dsn' => getenv('TALARIA_DSN') ?: 'https://api.newtalaria.com',
    'apiKey' => getenv('TALARIA_API_KEY'),
    'environment' => getenv('APP_ENV') ?: 'production',
    'release' => getenv('APP_RELEASE'),
]);

Capture exceptions

php
try {
    riskyOperation();
} catch (Throwable $e) {
    $client->captureException($e, [
        'tags' => ['area' => 'checkout'],
    ]);
    throw $e;
}

Environments & releases

Set environment and optional release from your deploy config so the dashboard can filter issues and correlate releases.

Troubleshooting

  • 401/403 — check API key and that it belongs to the target project.
  • No issue appears — confirm environment filter in the dashboard.
  • Rejected events — validate JSON shape against the API overview.

Prefer another language? See all SDKs or send events over HTTP via the API overview.