Download the PHP package curentis/openfga-php without Composer

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

curentis/openfga-php

CI

PHP SDK for OpenFGA — fine-grained, relationship-based authorization (Zanzibar-style).

This library targets production PHP applications: a typed high-level client (OpenFgaClientInterface), generated request/response models from the OpenFGA OpenAPI spec, PSR-18 HTTP with retries and error mapping, and extension points when you need custom write/batch-check behavior or a decorated client.

Install

Any PSR-18 HTTP client works (Guzzle, Symfony HttpClient, etc.). Optional: symfony/cache for PSR-16 OAuth token caching across PHP-FPM workers.

Requirements

Component Version
PHP 8.3, 8.4, or 8.5 (SUPPORTED_RUNTIMES.md)
OpenFGA server v1.10.0+ (integration tests also run against v1.21.0)

Quickstart

Configuration

ClientConfiguration is the single place to wire URL, store context, credentials, HTTP stack, and optional factories:

Option Description
apiUrl OpenFGA base URL (default http://localhost:8080)
storeId / authorizationModelId Default ULIDs for store-scoped APIs (optional)
credentials ApiToken, ClientCredentials, ClientAssertion, or NoCredentials
tokenCache Optional PSR-16 cache for OAuth access tokens
httpClient, requestFactory, streamFactory, uriFactory Override PSR-18 / PSR-17 discovery
retry RetryOptions (max retries, backoff, wall-clock deadline, per-attempt cap)
defaultHeaders Headers sent on every request
componentFactory Custom write/batch-check runners and consistency body factory
tokenCacheKey Optional 32-byte sodium key that encrypts cached OAuth tokens
telemetry Optional PSR-3 logger and PSR-14 dispatcher

Immutable helpers withStoreId() / withAuthorizationModelId() return a new client; per-call overrides use RequestOptions (store, model, headers). Details: docs/getting-started.md.

Authentication (summary)

See examples/authentication_api_token.php.

Features

Stores and authorization models

Create and manage stores; write and read authorization models; readLatestAuthorizationModel() for the newest model id in a store.

Tuples (writes)

Checks and batch operations

Queries

Assertions and low-level API

Full API walkthrough: docs/client-operations.md.

Customization

Depend on interfaces in your app; swap implementations without forking the SDK:

Interface Typical use
OpenFgaClientInterface Application entry point; decorators for logging/metrics
OpenFgaClientFactoryInterface Custom client wiring
ClientComponentFactoryInterface Custom WriteRunner / BatchCheckRunner / consistency mapping
OpenFgaApiInterface / TransportInterface Advanced HTTP or API wrapping

Guide: examples/custom_components.php.

Documentation and examples

Resource Description
docs/README.md Documentation index
docs/getting-started.md Install, configuration, first checks
docs/authentication.md Tokens and OAuth
docs/client-operations.md Writes, batch check, consistency, raw requests
docs/customization.md Extension interfaces
docs/error-handling.md Exception hierarchy and partial writes
docs/production.md Timeouts, retries, token cache, consistency
examples/README.md Runnable scripts

Development

On PHP 8.3 with locked dependencies, CI also enforces 100% line coverage (hand-written src/, excluding generated src/Model) and 100% Infection MSI.

Codegen from the vendored OpenAPI spec:

See AGENTS.md.

Acknowledgements

License

Apache-2.0 — see LICENSE.


All versions of openfga-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
php-http/discovery Version ^1.19
psr/clock Version ^1.0
psr/event-dispatcher Version ^1.0
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/log Version ^3.0
psr/simple-cache Version ^2.0 || ^3.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 curentis/openfga-php contains the following files

Loading the files please wait ...