40102: Incompatible credentials

incompatible_credentials

The credentials presented were valid but did not match the request, for example the client ID they permit differed from the one in use, or they belonged to a different application than the connection being resumed.

What you should do

When reauthenticating an existing connection, use credentials that match the connection's original ones: the same Ably application, the same API key origin, and the same client ID. To use different credentials, open a new connection instead.

Why it happens

The credentials were valid but incompatible with the connection they were applied to. Typical causes are a token whose client ID differs from the connection's, a reauthentication using a key from a different Ably application, or an attempt to change capabilities mid-connection with a different key.

What you'll see

The error is reported with code 40102 and HTTP status 401. The message is typically Invalid clientId for credentials.