Download the PHP package fusionauth/fusionauth-client without Composer

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

FusionAuth PHP Client semver 2.0.0 compliant

Intro

If you're integrating FusionAuth with a PHP application, this library will speed up your development time. Please also make sure to check our SDK Usage Suggestions page.

For additional information and documentation on FusionAuth refer to https://fusionauth.io.

Install

The most preferred way to use the client library is to install the fusionauth/fusionauth-client package via Composer by running the command below at your project root folder.

Then, include the composer autoloader in your PHP files.

Examples

Set Up

First, you have to make sure you have a running FusionAuth instance. If you don't have one already, the easiest way to install FusionAuth is via Docker, but there are other ways. By default, it'll be running on localhost:9011.

Then, you have to create an API Key in the admin UI to allow calling API endpoints.

You are now ready to use this library!

Error Handling

After every request is made, you need to check for any errors and handle them. To avoid cluttering things up, we'll omit the error handling in the next examples, but you should do something like the following.

Create the Client

To make requests to the API, first you need to create a FusionAuthClient instance with the API Key created and the server address where FusionAuth is running.

Create an Application

To create an Application, use the createApplication() method.

Check the API docs for this endpoint

Adding Roles to an Existing Application

To add roles to an Application, use createApplicationRole().

Check the API docs for this endpoint

Retrieve Application Details

To fetch details about an Application, use retrieveApplication().

Check the API docs for this endpoint

Delete an Application

To delete an Application, use deleteApplication().

Check the API docs for this endpoint

Lock a User

To prevent a User from logging in, use deactivateUser().

Check the API docs for this endpoint

Registering a User

To register a User in an Application, use register().

The code below also adds a customer role and a custom appBackgroundColor property to the User Registration.

Check the API docs for this endpoint

Questions and support

If you find any bugs in this library, please open an issue. Note that changes to the FusionAuthClient class have to be done on the FusionAuth Client Builder repository, which is responsible for generating that file.

But if you have a question or support issue, we'd love to hear from you.

If you have a paid plan with support included, please open a ticket in your account portal. Learn more about paid plan here.

Otherwise, please post your question in the community forum.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-php-client.

Note: if you want to change the FusionAuthClient class, you have to do it on the FusionAuth Client Builder repository, which is responsible for generating all client libraries we support.

License

This code is available as open source under the terms of the Apache v2.0 License.

Upgrade Policy

This library is built automatically to keep track of the FusionAuth API, and may also receive updates with bug fixes, security patches, tests, code samples, or documentation changes.

These releases may also update dependencies, language engines, and operating systems, as we\'ll follow the deprecation and sunsetting policies of the underlying technologies that it uses.

This means that after a dependency (e.g. language, framework, or operating system) is deprecated by its maintainer, this library will also be deprecated by us, and will eventually be updated to use a newer version.


All versions of fusionauth-client with dependencies

PHP Build Version
Package Version
Requires 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 fusionauth/fusionauth-client contains the following files

Loading the files please wait ....