"Uncaught (in promise) TypeError: can't access property "code", t.t0.response.body is null"

Having trouble registering a user in the following code:

const client = new AmityClient({apiKey, apiEndpoint})
        const success = wait client.registerSession({userId})
        console.log(success)

The error is:

  1. XHRPOST
    http://wowness.local/eu/api/v4/sessions
    [HTTP/1.1 404 Not Found 19ms]

  2. Uncaught (in promise) TypeError: can’t access property “code”, t.t0.response.body is null

I need help

Hello,

Could you please verify your apiEndpoint once more? It is recommended that the apiEndpoint be ‘https://api.eu.amity.co’ instead of ‘http://wowness.local’. If you have any questions or need further assistance, feel free to let us know.

Best regards,

Support Team