Session Management and Profiles
This guide explains how to connect to your Dolibarr ERP from HtkDoli, and how to manage your different profiles securely.
Connection to your Dolibarr instance
To connect, the HtkDoli application requires two main pieces of information from your Dolibarr instance:
- The URL of the instance: The web address of your Dolibarr server (for example:
https://mon-erp.example.com/api/index.php). - Your identifiers or an API key: You can connect either using your usual identifier and password, or directly with an API key generated in Dolibarr.
User interface
- When opening the application, the login screen is displayed.
- Enter the URL of your Dolibarr instance.
- Enter your username and password (or API key).
- Press the connect button.
The application will verify your information with the server. If successful, you will be redirected to the app dashboard.
Multi-Account and Profile Management
HtkDoli is designed for users managing multiple businesses or working with multiple instances of Dolibarr.
User interface
- Change profile: In the main menu (or settings), you will find a profile manager. It allows you to easily switch from one account to another.
- Add Profile: You can add a new profile by clicking the add (+) button, which will take you back to the login screen to enter the information for the new instance.
- Delete a profile: You can delete an existing profile if it is no longer needed.
Strict data isolation
Security and privacy are at the heart of HtkDoli’s architecture:
- Separate databases: Each profile has its own local SQLite database (
Profile_{UUID}.store). - No information leak: Cache, sessions and preferences (
UserDefaults) are strictly linked to the active profile. - Clean session termination: When changing profiles or logging out, background processes (like synchronization or Live Activities) related to the previous profile are explicitly stopped to prevent interference.
Dolibarr permissions required
For the connection and synchronization to work correctly, it is imperative that certain permissions and configurations are active on the Dolibarr side.
1. Enabling REST API
Your Dolibarr instance must have the API/Web services REST module activated.
- Configuration: Connect to Dolibarr via a web browser, go to Configuration > Modules/Applications and activate the “REST API” module.
2. User rights
The user you are connecting with must have the appropriate permissions in Dolibarr to interact with the modules.
- API Access: The user must have authorization to consult and use the APIs.
- Rights by module: If you do not have the right to see “Third Parties” or “Invoices” in the Dolibarr web configuration, the API will refuse access, and this data will not appear in HtkDoli.
- Creation/Modification: Creation, editing or deletion actions via the application also require the corresponding rights for your user in Dolibarr.