Multiple accounts
Creating broker accounts, handling authentication and authorization processes should be implemented on your backend side. Your backend server should also process users' trades and provide the library with users' data through the Broker API. The library only displays users' trading data and notifies your Broker API implementation about user actions. Refer to Authentication for more information on authentication approaches and how the library handles users logging into their broker accounts.
The Account Manager is designed to display the trading data of a particular user account. Users can have multiple accounts and switch between them using the drop-down menu in the Account Manager.
This menu appears automatically when accountsMetainfo
returns an array of objects.
When users switch accounts, the library calls the setCurrentAccount
method, providing your backend server with the ID of the requested account.
See the CodePen example below.