Configuring SDK For SaaSus Platform
Check your SaaS ID, API key, and client secret
First, view your API key in the SaaSus Development Console.
This key is used to configure the application.
A "SaaS ID" is typically generated by default.
If needed, you can use your existing SaaS ID or generate a new one by clicking the Reissue SaaS ID button.
In the initial state, an "API key" is not automatically generated.
If necessary, click the "Issue API Key" button to issue a new key.
Please note that if you reissue the SaaS ID after the SaaS operation has actually started, you will also need to update the SaaS ID used within the SaaS application.
Also, please be extremely careful not to leak your API key to outside parties. The API keys shown in this tutorial are no longer available.
Preparing to use SaaSus SDK
Now, let's open the sample application we just prepared in the development environment.
As mentioned at the beginning, the docker container has been started using init.sh
, and
- For Laravel, check that the sample application is running at http://localhost/board.
- For Express, check that it is running at http://localhost/login/.
First, to use the SaaSus Platform, you need to integrate the SaaSus SDK into your application.
- For Laravel, use Composer.
- For Express, use npm.
Open a terminal and set up the SDK.
- Laravel (Bash)
- Express (Bash)
repo$ docker compose exec php bash
root@xxx:/var/www# cd api
root@xxx:/var/www/api# composer require saasus-platform/saasus-sdk-php
repo$ docker compose exec node bash
root@xxx:/app# npm install saasus-sdk
root@xxx:/app# exit
Setting Environment Variables
After installing the SaaSus SDK, set the environment variables required to use it.
First, copy the .env.example
file in the api
directory to create a .env
file:
cp api/.env.example api/.env
Next, open the newly created .env
file and enter the following values:
Environment Variables for the SaaSus Platform
SAASUS_SAAS_ID="Enter your SaaS ID"
SAASUS_API_KEY="Enter your API key"
SAASUS_SECRET_KEY="Enter your client secret"
SAASUS_LOGIN_URL="Enter your login screen URL"
You can find these values in the SaaSus development console:
- On the Basics > API Key screen:
SAASUS_SAAS_ID
,SAASUS_API_KEY
,SAASUS_SECRET_KEY
- On the Authentication Authorization > Advanced Settings screen:
SAASUS_LOGIN_URL
With this, the basic setup of the SDK is complete.