Download the PHP package openhandle/sdk without Composer

On this page you can find all versions of the php package openhandle/sdk. 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

OpenHandle PHP SDK

The official PHP client for the OpenHandle API.

Installation

The package supports PHP 8.2 and newer. It uses Guzzle for HTTP and ships typed models and PHPStan generics for every response.

Usage

Create a Test key in the Openhandle dashboard, store it as OPENHANDLE_TEST_KEY, and create one reusable client:

The key selects the environment. oh_test_ keys return deterministic synthetic data with a $0.000 actual charge; oh_live_ keys use real public identifiers and normal billing. Never expose an API key in client-side code.

See the API reference for every operation.

Resource selection

The SDK follows one predictable grammar:

Only terminal operations such as get, list, search, and fetch perform network requests. Selecting a resource is synchronous and reusable:

A profile selector accepts a username shorthand or an explicit reference:

A raw string is never treated as a platform ID. profile('12356') selects the username 12356; profile(id: '12356') selects platform ID 12356. Numeric reference values are rejected because platform IDs are opaque strings.

Call $openhandle->fetch($url) when you do not know which resource a supported social URL represents. TikTok short links such as tiktok.com/t/… and vm.tiktok.com/… are rejected by selectors and only work through fetch, which expands them server-side.

Pass operation options as named arguments. Their positions are not part of the public API and can change when the API adds an option.

Pagination

A list or search operation returns one typed page:

next() returns null after the final page without making a request. items() iterates lazily across pages, one request per page:

Responses

Every response preserves the public envelope. data is a typed model from the OpenHandle\Models namespace, and metadata is available on the response:

A missing metric is null. It is never 0.

Type your own functions with the generic response and page types:

Errors and retries

The SDK throws OpenHandleError with the documented fields. Branch on code, never on message:

Retryable failures are retried automatically with capped exponential backoff and Retry-After support. Configure the client, or override per request:

Pass your own Guzzle client as httpClient to add proxies or middleware.

Locally invalid references throw OpenHandleReferenceError before any request is made. ReferenceMismatchError reports a social URL that belongs to a different platform or resource than the selector.

License

MIT


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
composer-runtime-api Version ^2.2
guzzlehttp/guzzle Version ^7.9
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 openhandle/sdk contains the following files

Loading the files please wait ...