You might have to find your userid if it differs from mine (1000), to do that, just type:
$ id
and you want the number for your "uid" in the path below for XDG_RUNTIME_DIR=/run/user/<id goes here> see below:
The sudo -H flag: Request that the security policy set the HOME environment variable to the home directory specified by the target user's password database entry. You may not need this flag.
The sudo -E flag for sudo retains env variables you pass to it while it is running under sudo
2 issues happen here often is that your DISPLAY isn't set automatically under sudo (at least mine isn't) and the other issue is that if you try to register and you are using a global installation such as the .deb file, or from arch linux aur, it will not have the proper permissions to make changes.
The following command is what allowed me to use /opt/cxoffice/bin/cxregister and login with my credentials and successfully register. One could always go the route of installing in their home directory, but to each their own computer.
sudo -HE DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 /opt/cxoffice/bin/cxregister