Add a server peer.
Can reject with any of the following error codes (accessed via err.code
):
INVALID_URL
: the base URL is invalid, likely due to user error.MISSING_DATA
: some required data is missing in order to add the server
peer. For example, the project must have a name.NETWORK_ERROR
: there was an issue connecting to the server. Is the
device online? Is the server online?SERVER_HAS_TOO_MANY_PROJECTS
: the server limits the number of projects
it can have, and it's at the limit.PROJECT_NOT_IN_SERVER_ALLOWLIST
: the server only allows specific
projects to be added and ours wasn't one of them.INVALID_SERVER_RESPONSE
: we connected to the server but it returned
an unexpected response. Is the server running a compatible version of
CoMapeo Cloud?If err.code
is not specified, that indicates a bug in this module.
Optional
options: { Allow insecure network connections. Should only be used in tests.
Send an invite. Resolves when receiving a response. Rejects if the invite is canceled, or if something else goes wrong.
Hard-code the invite ID. Only for tests.
public key of this device as hex string