Download the PHP package matgro/dify-sdk without Composer

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

Dify SDK for PHP

matgro/dify-sdk is a framework-agnostic PHP client for the standard Dify datasets and documents endpoints. It deliberately contains no Laravel configuration, queue, persistence, storage, UI, or credential management.

Supported API

The public client implements current documented Dify Knowledge Base endpoints. File-based document update is intentionally omitted because Dify marks that endpoint as deprecated; a future SDK release can model the current general document-update endpoint after its payload is verified.

Requirements

Installation

After a tagged release is registered on Packagist:

Usage

Create the SDK from configuration owned by the consuming application. Never commit an API key or internal Dify URL.

All operations return immutable DTOs. Pagination results provide items(), page(), limit(), total(), and hasMore(); dataset and document DTOs provide typed accessors such as id() and name().

Errors and retries

Remote HTTP failures are reported as Matgro\Dify\Exception\DifyApiException. Its message is sanitized and never contains the API key or remote response body. Invalid JSON responses are also converted to that exception.

The client retries only idempotent GET requests for transport failures, HTTP 429, and HTTP 5xx responses. It never automatically retries writes because a timeout after a remote write can otherwise create duplicate datasets/documents. A consuming application should reconcile the remote state before deciding whether to retry a write.

The constructor defaults to a 30-second request timeout, a 10-second connection timeout, two read retries, and a 200 ms retry delay. The final four constructor arguments configure those values.

Laravel integration

The SDK is framework-agnostic. A Laravel application should bind DifyClientInterface in its own service provider and obtain the base URL/API key from server-side configuration. File validation, private storage, queueing, audit records, and deletion consistency remain application responsibilities.

Development

Publishing maintainers checklist

  1. Ensure the suite and Composer validation pass.
  2. Commit the complete repository and push it to the public GitHub repository for matgro/dify-sdk.
  3. Verify the GitHub Actions PHP matrix.
  4. Create an immutable SemVer Git tag, beginning with v0.1.0 for the initial public API.
  5. Register the repository in Packagist and verify installation in a clean project.

The package archive excludes development dependencies, tests, CI files, and test cache.

Security

Never commit API keys, Authorization headers, internal URLs, document contents, private dataset identifiers, or application logs. Report vulnerabilities privately to the maintainers rather than opening a public issue.

License

MIT. See LICENSE.


All versions of dify-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
guzzlehttp/guzzle Version ^7.0
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 matgro/dify-sdk contains the following files

Loading the files please wait ...