Download the PHP package linkskipper/sdk without Composer

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

linkskipper/sdk

Official PHP client for the Link Skipper link-resolving API. It turns the asynchronous resolve flow into a single call.

Install

Quick start — resolveAndWait

resolveAndWait submits the URL, then transparently polls the job until it finishes, returning the destination. A cache hit returns instantly; a cache miss is polled for you.

Configuration

LinkSkipper::create() covers the common case. For full control, build a Config:

Option Default Description
apiKey (required) Sent as Authorization: Bearer <apiKey>.
baseUrl https://linkskipper.app API origin.
timeoutMs 30000 Per-request timeout.
pollIntervalMs 2000 Delay between job polls in resolveAndWait.
maxWaitMs 120000 Total budget for resolveAndWait before it throws TimeoutException.
retryPolicy 3 attempts Backoff for network errors, 5xx, and 429.
transport CurlTransport Swap in Psr18Transport to reuse an existing PSR-18 client.

Bring your own PSR-18 client

API

resolve(string $url, ?string $idempotencyKey = null): ResolveResult

One-shot, non-blocking. On a cache hit the result has status === ResolveStatus::Done and a targetUrl; otherwise it is ResolveStatus::Queued with a jobId and pollUrl.

getJob(string $jobId): Job

Fetch a single job's current state.

resolveAndWait(string $url, ?string $idempotencyKey, ?int $pollIntervalMs, ?int $maxWaitMs): ResolvedLink

Resolve, then poll until the job is done, failed, or invalid. Returns the resolved link on success, throws JobFailedException on failed/invalid, and TimeoutException once maxWaitMs elapses.

account(): Account / providers(): ProviderEntry[]

Errors

Every non-2xx application/problem+json response is mapped to a typed exception. All extend ApiException, which exposes status(), errorCode(), detail(), balance(), and retryAfter().

Code Exception HTTP
invalid_request InvalidRequestException 400
invalid_key InvalidKeyException 401
out_of_credits OutOfCreditsException 402
forbidden_scope ForbiddenScopeException 403
not_found NotFoundException 404
link_removed LinkRemovedException 410
unsupported_link UnsupportedLinkException 422
rate_limited RateLimitedException 429
quota_exceeded QuotaExceededException 429
resolve_failed ResolveFailedException 502
provider_down ProviderDownException 503

Non-HTTP outcomes use NetworkException (transport failure after retries), TimeoutException (poll deadline), and JobFailedException (terminal failed/invalid job). Every exception extends LinkSkipperException.

Webhooks

Pass webhook_url on a resolve and Link Skipper POSTs the result to your endpoint, signed with X-LinkSkipper-Signature: t=<unixSeconds>,v1=<hmacSha256>. Verify every delivery against your key's webhook secret with Webhook::verify, which compares the HMAC with hash_equals, enforces a freshness window (default 300s), and returns a typed WebhookEvent. Pass the raw request body string.

Retries

Network errors, 5xx, and 429 are retried with bounded exponential backoff. A Retry-After header is always honored. Other 4xx responses are never retried.

Testing

License

MIT © Link Skipper


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-json Version *
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 linkskipper/sdk contains the following files

Loading the files please wait ...