Accedo Control Setup
Introduction
Elevate uses Accedo Control as the default provider for:
- Configuguration
- CMS
- i18n
In order to do so an Application Group and Application has been setup and an applicationKey
is used to do create the sessions for all the Control requests.
That applicationKey is set as controlAppKey
inside the inner configuration and can be updated by:
- add
NEXT_PUBLIC_CONTROL_APP_KEY
env var. - Update config setup to use a local version of it (
src/config/app
).
Implementation Details
As a server-centric request framework, most of the fetch request of the application will be done on the server. This means that the server will execute the requests to Control without having an associated deviceId as it's the server the one doing the request. We could sent some headers to pass the client deviceId and any other needed info to create, store and handle client deviceId, but instead we have focus on building a model were the server will handle the request and cache of such, and the client will only logs sessions, so we can keep track of unique devices.
If your projects requires more intense information for each device traffic inside Control, you will need to update such implementation.
Server-side
We have create a shared provider logic inside src/providers/shared/controlShared.ts
which is in charge of creating and storing the Control client instance as documented in Control SDK accedoOne.
Created as a Singleton, it keeps a single instance and handle the session creating, revalidation and recreation based on the segmentation conditions.
The session is stored using the Memory Cache utility so it can be retrieved when needed.
Client-side
To be able to keep track of sessions from different devices, Elevate Web implemented a browser-based session tracking inside src/providers/shared/controlShared.ts
called createAccedoControlBrowserSession
that it's called on app startup inside ClientSideInitialization
Utilities
Together with the session logic, we have created as part of the DebugInfoOverlay
a section to display Control information such as:
- Control local/browser session
- Control deviceId
- Control AppKey