Create the client before trying to authenticate it

Since the `client.auth` is an asynchronous operation, we need to create the client before trying to auth, otherwise the client might be undefined when trying to call `client.once`