Download the PHP package hamrocdn/sdk without Composer

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

HamroCDN PHP SDK

Lint & Test PR Quality Gate Status

Official PHP SDK for HamroCDN β€” a simple, typed, and framework-agnostic way to upload, fetch, and manage files from your HamroCDN account.


πŸ“¦ Installation

Install via Composer:

Requirements

That’s it.
No Laravel dependencies, no magic β€” just pure PHP.


βš™οΈ Configuration

You can pass your API key directly, or rely on environment/config values if available.

Alternatively, if your environment has them:

the SDK automatically detects and uses them.


⚑ Quick Start

Here’s a quick example showing upload and fetch in action:


πŸš€ Usage

This SDK make use of public API provided by HamroCDN. To get your API key, sign up at hamrocdn.com and navigate to Edit Profile page in your dashboard.

1. List Uploads

1.1 Paginated

The index() method returns paginated results.
You can provide pagination parameters such as page and per_page:

Returns an object containing data (array of Upload models) and meta (pagination info).

Example of returned metadata:

1.2 All Uploads

To fetch all uploads without pagination, use the all() method:

Returns an array of Upload models.


2. Fetch a Single Upload


3. Upload a File

To delete the file after a certain time, use the deleteAfter parameter (in seconds):

This will set the deleteAt property on the returned Upload model.


4. Upload by Remote URL

Also supports the deleteAfter parameter.


🧱 Models

πŸ—‚ HamroCDN\Models\Upload

Property Type Description
nanoId string Unique identifier of the upload
user User or null Owner of the file (if authenticated)
deleteAt Carbon or null Deletion timestamp if temporary
original File File information (URL, size)

Methods


πŸ‘€ HamroCDN\Models\User

Property Type Description
name string Name of the uploader
email string Email of the uploader

Methods


🧾 HamroCDN\Models\File

Property Type Description
url string Public CDN URL
size int File size in bytes

Methods


⚑ Error Handling

All SDK errors extend HamroCDN\Exceptions\HamroCDNException.

Example:

The SDK automatically wraps:


πŸ§ͺ Testing

This SDK is built with Pest and supports real API integration tests.
A dedicated testing environment is configured within the HamroCDN infrastructure, ensuring safe, production-like validations.

Run tests locally:


πŸͺ„ Framework Integrations

This SDK is framework-agnostic. If you’re using Laravel, check out the companion package:

πŸ‘‰ hamrocdn/laravel

It provides service providers, configuration publishing, and automatic Facade binding.


🧩 Type Safety / Static Analysis


πŸ“„ License

This package is open-sourced software licensed under the MIT license.


🀝 Contributing

Contributions are welcome! Please create a pull request or open an issue if you find any bugs or have feature requests.


⭐ Support

If you find this package useful, please consider starring the repository on GitHub to show your support.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^7.10
nesbot/carbon Version ^3.10
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 hamrocdn/sdk contains the following files

Loading the files please wait ...