Download the PHP package openstatus/sdk-php without Composer

On this page you can find all versions of the php package openstatus/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk-php

Openstatus PHP SDK

License: MIT PHP 8.4+

Official PHP SDK for Openstatus — the open-source status page with uptime monitoring.

Table of Contents

Features

Monitoring

Status Page

Notifications

Developer Experience

Installation

Requires PHP 8.4 or later.

Quick Start

Authentication

All API requests require an API key. Get yours from the Openstatus dashboard.

Recommended: configure the client once

Alternative: per-call headers

Every service method accepts an optional second argument: an array of headers merged into the request. Useful for tracing IDs or one-off overrides.

Environment Variables

Variable Description Default
OPENSTATUS_API_KEY Your Openstatus API key Required for authenticated calls
OPENSTATUS_API_URL Custom API endpoint https://api.openstatus.dev

If apiKey is not passed in ClientOptions, the SDK falls back to OPENSTATUS_API_KEY. Same for baseUrl / OPENSTATUS_API_URL.

SDK Reference

All examples below assume:

Monitor Service

Manage HTTP, TCP, and DNS monitors.

createHTTPMonitor(request)

Create an HTTP/HTTPS monitor.

updateHTTPMonitor(request)

Update an existing HTTP monitor.

createTCPMonitor(request) / updateTCPMonitor(request)

Monitor TCP services.

createDNSMonitor(request) / updateDNSMonitor(request)

Monitor DNS records.

getMonitor(request)

Fetch a single monitor (returns a MonitorConfig discriminated by type).

listMonitors(request)

List all monitors in the workspace, grouped by type.

triggerMonitor(request)

Manually run a monitor immediately. Rate-limited by the synthetic-checks quota.

deleteMonitor(request)

getMonitorStatus(request)

Per-region status snapshot.

getMonitorSummary(request)

Aggregated latency percentiles and request counts.

listMonitorHTTPResponseLogs(request)

Recent HTTP response log entries with pagination.

getMonitorHTTPResponseLog(request)

Single log entry with full headers and body assertions.

Health Service

check(request)

Returns the API's serving status. No authentication required — useful as a liveness check.

Status Report Service

Manage incident reports with a lifecycle: investigating → identified → monitoring → resolved.

createStatusReport(request)

getStatusReport(request) / listStatusReports(request) / updateStatusReport(request) / deleteStatusReport(request)

addStatusReportUpdate(request)

Status Page Service

Manage public status pages with components, component groups, and subscribers.

createStatusPage(request)

getStatusPage(request) / listStatusPages(request) / updateStatusPage(request) / deleteStatusPage(request)

getStatusPageContent(request) / getOverallStatus(request)

Components

Add a monitor-backed component or a static component, update it, remove it.

Component groups

Subscribers

Maintenance Service

Schedule planned maintenance windows. Subscribers can be notified automatically.

Notification Service

Configure notification channels and check usage limits.

Other methods:

Reference

Monitor Options

Field Type Notes
name string Required, max 256 chars.
url string Required, max 2048 chars.
periodicity Periodicity (enum int) Required. See Enums.
method HTTPMethod (enum int) HTTP monitors only. Defaults to HTTP_METHOD_GET.
regions Region[] (enum int list) Required. See Regions.
active bool Defaults to false.
timeout int (ms) 0–120000. Defaults to 45000.
degraded_at int (ms) Optional latency threshold for "degraded" status.
retry int 0–10. Defaults to 3.
follow_redirects bool Defaults to true.
body string Request body (HTTP).
headers Headers[] Custom request headers (HTTP).
status_code_assertions StatusCodeAssertion[] See Assertions.
body_assertions BodyAssertion[] See Assertions.
header_assertions HeaderAssertion[] See Assertions.
description string Optional description.
public bool Whether the monitor is publicly visible.

Assertions

Assertions are evaluated against each check response. All matching assertions must pass for a check to be successful.

Regions

28 regions are available via the Region enum:

Enums

All enums emitted by the protobuf compiler are plain classes with const int values. The generated value getters return int; use the static name() helper to convert to a string.

Notable enums you'll encounter:

Working with int64 fields

int64 fields (timestamps, percentiles, latencies measured in nanoseconds) return int|string from getters because protoc-gen-php falls back to strings on 32-bit platforms to avoid silent overflow.

On 64-bit PHP — the default on macOS and Linux — the value is always an int. If you need to be safe across both platforms:

The setter accepts either, so passing an int directly works.

Error Handling

All Connect RPC errors raise Openstatus\Sdk\Exception\OpenstatusException (or a subclass). The exception carries the Connect error code, HTTP status, parsed details array, and raw response body.

Connect code Exception
unauthenticated Openstatus\Sdk\Exception\AuthenticationException
not_found Openstatus\Sdk\Exception\NotFoundException
invalid_argument Openstatus\Sdk\Exception\InvalidArgumentException
permission_denied Openstatus\Sdk\Exception\PermissionDeniedException
resource_exhausted Openstatus\Sdk\Exception\RateLimitException
unavailable Openstatus\Sdk\Exception\ServiceUnavailableException
anything else Openstatus\Sdk\Exception\OpenstatusException

Framework integration

Symfony

Register the client as a service in config/services.yaml:

Inject into any controller or service:

Laravel

In a service provider's register() method:

Resolve from the container:

Custom PSR-18 client

Bring your own HTTP client (Symfony HttpClient, Saloon, Mock, etc.). Anything implementing Psr\Http\Client\ClientInterface works.

Pair with a custom PSR-3 logger to log every request/response at DEBUG:

Related

License

MIT — see LICENSE.


All versions of sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-json Version *
google/protobuf Version ^4.29
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/log Version ^3.0
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package openstatus/sdk-php contains the following files

Loading the files please wait ...