Search by

Official PHP client for the Pathly monitoring public /v1 API

v0.1.0 2026-09-24 06:57 UTC

This package is not auto-updated.

Last update: 2026-09-24 14:00:39 UTC


README

English · Français · Español

Powered by Pathly Website API docs Start free

To use this SDK, you need an API key. Get your free API key by signing up here: https://pathlyhq.com/en/login?mode=signup&utm_source=github&utm_medium=readme&utm_campaign=signup_cta.

Get started in one click. Create a free account on Pathly (sign up), create an API key in the console, then export PATHLY_API_TOKEN. This project is the official bridge to Pathly monitoring — real-browser and HTTP checks for checkout, login and availability, with data hosted in the EU. Full API reference: pathlyhq.com/en/developers.

Official PHP client for the Pathly public /v1 API. Automate Pathly monitoring from Laravel, Symfony or plain PHP: HTTP scenarios, maintenance windows, signed webhooks and SLA targets.

composer require pathlyhq/sdk
export PATHLY_API_TOKEN="sp_…"
<?php
use Pathly\Client;
use Pathly\ScenarioInput;

$client = new Client(); // reads PATHLY_API_TOKEN
$scenario = $client->createScenario(new ScenarioInput(
    name: 'Checkout',
    url: 'https://shop.example.com/cart',
    intervalSec: 300,
    expectText: 'Your cart',
    tags: ['prod', 'payment'],
));
echo $scenario->id, PHP_EOL;

Why Pathly monitoring

Pathly is EU-hosted synthetic monitoring. This Composer package (pathlyhq/sdk) is the PHP twin of the TypeScript, Python and Go SDKs documented on pathlyhq.com/en/developers and pathlyhq.com/fr/developers.

Need Link
Product overview pathlyhq.com
API & SDK docs (EN) pathlyhq.com/en/developers
API & SDK docs (FR) pathlyhq.com/fr/developers
Pathly monitoring pathlyhq.com

Authentication

Variable Purpose
PATHLY_API_TOKEN Organization API key (sp_ prefix). Required.
PATHLY_API_URL API base. Defaults to https://api.pathlyhq.com.

Never hard-code the token. Prefer the environment or a secret store.

Client::ping() calls GET /v1/usage and accepts HTTP 403: the key is valid but lacks org:read. Scopes: scenarios:*, alerting:*, maintenance:*, sla:* — see pathlyhq.com/en/developers.

Resources

Resource Methods
Scenario (HTTP) createScenario, getScenario, updateScenario, deleteScenario, listScenarios, muteScenario
Maintenance window createMaintenanceWindow, getMaintenanceWindow, deleteMaintenanceWindow, listMaintenanceWindows
Webhook createWebhook, getWebhook, deleteWebhook, listWebhooks
SLA target upsertSlaTarget (PUT), getSlaTarget, deleteSlaTarget, listSlaTargets

Browser journeys are created in the Pathly console. This SDK manages HTTP Pathly monitoring scenarios only.

The webhook secret is returned once at creation. Store it in a vault. The API never returns the destination URL on read, only urlFingerprint.

Behavior

  • Creates send an Idempotency-Key (auto-generated UUID unless you pass one).
  • HTTP 429 and 5xx honour Retry-After (capped at 90 seconds, four attempts).
  • HTTP 404 raises NotFoundError (Pathly\is_not_found($err) helper).
  • Runtime: PHP 8.1+, ext-json only (no Guzzle required).

Development

composer install
composer test
# or: vendor/bin/phpunit --coverage-text

Coverage is required at 100%.

Examples: examples/. API reference: pathlyhq.com/en/developers · pathlyhq.com/fr/developers.

Related packages

Package Role
pathly-sdk-go Go
pathly-sdk-typescript @pathlyhq/sdk
pathly-sdk-python pathly
pathly-terraform-provider Terraform
Pathly Pathly monitoring product

About Pathly

Pathly is synthetic monitoring for agencies and e-commerce: replay the customer journey, catch broken checkouts before your clients call, and keep evidence (screenshot, step, runbook) ready for the invoice. Product: pathlyhq.com · Developers: pathlyhq.com/en/developers · Status & pricing: pathlyhq.com/en/pricing.

Author

Company Pathly
Author Simon Raynaud / keyral

See AUTHORS. Homepage: pathlyhq.com.

License

Apache-2.0