ably / ably-php

PHP client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
49 stars 10 forks source link

Error code 4001 #142

Closed ably-sync-bot closed 2 years ago

ably-sync-bot commented 2 years ago

Hi I used following configs but I get an error and this is so weird.

{"event":"pusher:error","data":{"message":"Malformed key name xxxxx - don't use your secret key, only your keyName (appId.keyId) (Ably error 40101)","code":4001}}

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: process.env.MIX_ABLY_APP_KEY,
    wsHost: 'realtime-pusher.ably.io',
    wsPort: 443,
    disableStats: true,
    encrypted: true,
});

window.Echo.channel("articles")
    .listen("AblyTestEvent" , (e) => {
     console.log(e);
})

┆Issue is synchronized with this Jira Uncategorised by Unito

ably-sync-bot commented 2 years ago

➤ Ricardo Crivelli commented:

Set MIX_ABLY_APP_KEY in .env file only with the public part of your key (bofore the : character).