A PHP Wrapper for LoginLlama - a suspicious login detection API

v1.1.0 2023-09-19 18:22 UTC

This package is auto-updated.

Last update: 2024-06-27 16:27:13 UTC


LoginLlama PHP Client

This PHP package provides an interface to interact with the LoginLlama API, which offers login status checks for users based on various parameters.


To install the LoginLlama PHP client, use Composer:

composer require joshghent/loginllama


First, include the necessary classes:

require_once 'vendor/autoload.php';


To initialize the LoginLlama class, provide your API token:

$loginLlama = new LoginLlama("YOUR_API_TOKEN");

Alternatively set the LOGINLLAMA_API_KEY environment variable and initialize the class without any parameters:

$loginLlama = new LoginLlama();

Checking Login Status

The primary function provided by this package is check_login, which checks the login status of a user based on various parameters.


  • ip_address (optional): The IP address of the user.
  • user_agent (optional): The user agent string of the user.
  • identity_key: The unique identity key for the user. This is a required parameter.

Return Value:

The function returns an array containing the result of the login check, including the status, a message, and any applicable codes indicating the reason for the status.


$result = $loginLlama->check_login([
    'ip_address' => '',
    'user_agent' => 'Mozilla/5.0',
    'identity_key' => 'validUser'

Error Handling

The check_login function will throw exceptions for various error scenarios, such as missing required parameters or API errors.


If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Your contributions are welcome!


This package is licensed under the GNU GPL v3.