Exsited PHP SDK Installation Guide (From GitHub)
This guide will help you set up and configure the Exsited PHP SDK in your local environment using the GitHub repository. Follow the steps to download, configure, and run the SDK with your provided credentials. Ideal for developers integrating Exsited's APIs into PHP-based applications.
Prerequisites
Before starting, ensure the following are installed and configured on your system:
- PHP version 7.4
- XAMPP or any other local server (ensure Apache is running)
- A code editor or IDE (e.g., VS Code, PhpStorm)
Downloading the SDK
You can obtain the SDK directly from GitHub.
Clone the SDK Repository
Open your terminal and run:
git clone https://github.com/exsited/exsited-php.git
Alternatively, download the ZIP from GitHub and extract it into your project directory.
Configuration
To configure the SDK, you will need the following credentials:
- Client ID
- Client Secret
- Redirect URL
Note: If you don’t have these credentials, please contact your designated Exsited representative.
Step 1: Create SDK Config File
In the root directory of the cloned SDK project, ensure there is a file named sdk-config.json
. If it doesn't exist, create one manually.
{
"apiVersion": "v3",
"reQuestTimeOut": 240
}
Explanation of SDK Config Fields
Key | Description |
---|---|
apiVersion | The default API version to be used by the SDK (e.g., "v3" ). |
reQuestTimeOut | The request timeout limit (in seconds) for API calls. Helps prevent hanging requests on slow connections. |
⚠️ File and field names are case-sensitive. Be sure to spell
"reQuestTimeOut"
exactly as shown above.
Step 2: Create Token File
Next, verify that a file named token.json
exists in the root directory of the SDK. If not, create it manually.
You can now include one or more sets of credentials inside a JSON array like this:
[
{
"apiUrl": "[EXSITED_API_BASE_URL]",
"appUrl": "[EXSITED_APP_URL]",
"client_id": "[YOUR_CLIENT_ID]",
"client_secret": "[YOUR_CLIENT_SECRET]",
"access_token": "[YOUR_ACCESS_TOKEN]",
"refresh_token": "[YOUR_REFRESH_TOKEN]",
"redirect_uri": "[YOUR_REDIRECT_URI]",
"authTokenRenewCallback": {}
},
{
"apiUrl": "[EXSITED_API_BASE_URL]",
"appUrl": "[EXSITED_APP_URL]",
"client_id": "[YOUR_CLIENT_ID]",
"client_secret": "[YOUR_CLIENT_SECRET]",
"access_token": "[YOUR_ACCESS_TOKEN]",
"refresh_token": "[YOUR_REFRESH_TOKEN]",
"redirect_uri": "[YOUR_REDIRECT_URI]",
"authTokenRenewCallback": {}
}
]
Explanation of Token File Fields
Key | Description |
---|---|
client_id | Your provided Client ID |
client_secret | Your provided Client Secret |
redirect_uri | Your authorized Redirect URL |
apiUrl | API base URL (e.g., staging or live) |
appUrl | App base URL |
Important Notes
- You can include multiple credential objects in an array format.
- Each object must be properly formatted and comma-separated.
- If using multiple accounts or environments, the SDK may provide a mechanism to select the appropriate configuration dynamically.