GetStream / stream-chat-js

JS / Browser Client - Build Chat with GetStream.io
https://getstream.io/chat/
Other
171 stars 74 forks source link

secretOrPrivateKey is not valid key material #1157

Open tayormi opened 11 months ago

tayormi commented 11 months ago

I am using a Supabase edge function to create tokens. When I call

const client = StreamChat.getInstance<StreamType>(
    Deno.env.get("GETSTREAM_API_KEY") as string,
    Deno.env.get("GETSTREAM_API_KEY_SECRET") as string,
);

I get the error below.

Error: secretOrPrivateKey is not valid key material
    at Object.de.exports [as sign] (https://esm.sh/v131/jsonwebtoken@9.0.1/deno/jsonwebtoken.mjs:10:10146)
    at Re (https://esm.sh/v131/stream-chat@8.10.1/deno/stream-chat.mjs:7:17877)
    at new o (https://esm.sh/v131/stream-chat@8.10.1/deno/stream-chat.mjs:7:20595)
    at new o (https://esm.sh/v131/stream-chat@8.10.1/deno/stream-chat.mjs:8:13970)
    at Function.value (https://esm.sh/v131/stream-chat@8.10.1/deno/stream-chat.mjs:8:59543)
    at 

I have battled this for days and I am on the verge of giving up.

rlee1990 commented 11 months ago

I got the same error not sure if its because of Deno or the package.

tkorsback commented 9 months ago

I have the exakt same error when using supabase edge functions.

Did you have any progress with this?

rahuldubey093 commented 1 week ago

Anyone found the solution yet?