FusionAuth Client written in PHP


If you're integrating FusionAuth with a PHP application, this library will speed up your development time.

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

Examples Usages:

Install the Code

To use the client library on your project simply copy the PHP source files from the src directory to your project or the following Composer package.


composer require fusionauth/fusionauth-client

Include composer autoloader

require __DIR__ . '/vendor/autoload.php';

Create the Client

$apiKey = "5a826da2-1e3a-49df-85ba-cd88575e4e9d";
$client = new FusionAuth\FusionAuthClient($apiKey, "http://localhost:9011");

Login a user

$applicationId = "68364852-7a38-4e15-8c48-394eceafa601";

$request = array();
$request["applicationId"] = $applicationId;
$request["loginId"] = "joe@fusionauth.io";
$request["password"] = "abc123";
$result = $client->login($request);
if (!$result->wasSuccessful()) {
 // Error

// Hooray! Success