AuthRocket PHP library
AuthRocket provides Auth as a Service, making it quick and easy to add signups, logins, social auth, a full user management UI, and much more to your app.
authrocket PHP library covers all of our Core API. It also covers select portions of the Extended API.
The library is designed to be installed using
composer. It should also be usable using any other method typically supported by composer-compatible packages.
For installation, run:
composer require authrocket/authrocket # alternate: php composer.phar require authrocket/authrocket
"authrocket/authrocket": "<2" to the
require section of your composer.json and run
You can also download
authrocket.phar, a .zip, or a .tar.gz of the latest release directly from GitHub: https://github.com/authrocket/authrocket-php/releases/latest
If you are using environment variables to manage external services like AuthRocket, then it's very easy to initialize the AuthRocket client:
$client = \AuthRocket\AuthRocket::autoConfigure();
Ensure these environment variables are set:
AUTHROCKET_API_KEY = ko_SAMPLE AUTHROCKET_URL = https://api-e1.authrocket.com/v1 AUTHROCKET_REALM = rl_SAMPLE # optional AUTHROCKET_JWT_SECRET = jsk_SAMPLE # optional
AUTHROCKET_URL must be updated based on what cluster your account is provisioned on.
AUTHROCKET_JWT_SECRET are optional. If you are using multiple realms, we recommend building a new client for each realm, just setting
$client = \AuthRocket\AuthRocket::autoConfigure([ 'realm' => 'rl_SAMPLE', 'jwtSecret' => 'jsk_SAMPLE' ]);
It's also possible to configure the AuthRocket client instance directly:
$client = new \AuthRocket\AuthRocket([ 'apiKey' => 'ko_SAMPLE', 'url' => 'https://api-e1.authrocket.com/v1', 'realm' => 'rl_SAMPLE', 'jwtSecret' => 'jsk_SAMPLE' ]);
Documentation is provided on our site:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request