There are two useful files from Directual React Boilerplate:
auth.js provides methods: .user, .sessionID, .isAutorised(), .hasRole().
setupProxy.js creates middleware proxy to directual-api, for resolving the problem linked with CORS. We need to install http-proxy-middleware.
Also you need to edit the .env file for connecting with Directual app:
You can find (or create) your App ID in API section: