NOTE: This guide is for the old combined app. For new installations, please use the sass_client app instead.
See SEPARATION.md for information about the app separation.
For new installations, use: ../sass_client/CLIENT_SETUP.md
This guide explains how to set up the SaaS Manager app on client ERPNext instances (legacy).
bench get-app sass_manager
bench --site [your-client-site] install-app sass_manager
bench --site [your-client-site] migrateAdd the following to your site_config.json file:
{
"saas_manager_url": "https://your-main-saas-manager.com",
"client_type": "ERP"
}Note: The saas_api_key will be automatically generated when you register the site.
You can register the site in two ways:
The site will automatically register on first sync. Just ensure saas_manager_url is configured.
Create a script or use the console:
from sass_manager.utils.client_sync import register_client_site
api_key = register_client_site(
site_name="My Client Site",
company="My Company Name",
client_type="ERP" # Options: ERP, Mobile POS, Desktop POS, Fiscalisation
)
# Save the API key to site_config.json
# Add: "saas_api_key": "generated-api-key"Add to your hooks.py file in the app:
scheduler_events = {
"hourly": [
"sass_manager.utils.client_tasks.hourly"
]
}Or if you want to sync more frequently, you can create a custom scheduled job.
To enforce user limits based on subscription package, add to your hooks.py:
doc_events = {
"User": {
"before_save": "sass_manager.hooks.user_events.validate_user_limit",
"on_update": "sass_manager.hooks.user_events.validate_user_limit"
}
}Note: User limit enforcement is optional. If not configured, users can be created without limit checks.
| Option | Required | Description | Default |
|---|---|---|---|
saas_manager_url |
Yes | URL of main SaaS manager app | - |
saas_api_key |
Yes* | API key for authentication | Auto-generated |
client_type |
No | Type of client (ERP, Mobile POS, Desktop POS, Fiscalisation) | ERP |
subscription_package |
No | Package name from main app | - |
subscription_active |
No | Whether subscription is active | false |
subscription_start_date |
No | Subscription start date | - |
subscription_end_date |
No | Subscription end date | - |
*API key is auto-generated on registration, but you can manually set it if needed.
To manually trigger a sync:
from sass_manager.utils.client_sync import sync_to_main_app
sync_to_main_app()from sass_manager.utils.client_sync import get_site_data
data = get_site_data()
print(data)- Check that
saas_manager_urlis correctly configured - Verify API key is set in
site_config.json - Check Error Log for sync errors
- Ensure main app is accessible from client site
- Verify hooks are configured in
hooks.py - Check subscription status in main app
- Verify package has
max_usersset - Check Error Log for limit check errors
- Ensure main app is accessible
- Check network connectivity
- Verify site URL is correct
- Check Error Log for registration errors
For issues, check the Error Log in ERPNext or contact: akingbolahan12@gmail.com