stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

secretOrPrivateKey is not valid key material

Open tayormi opened this issue 2 years ago • 2 comments

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/[email protected]/deno/jsonwebtoken.mjs:10:10146)
    at Re (https://esm.sh/v131/[email protected]/deno/stream-chat.mjs:7:17877)
    at new o (https://esm.sh/v131/[email protected]/deno/stream-chat.mjs:7:20595)
    at new o (https://esm.sh/v131/[email protected]/deno/stream-chat.mjs:8:13970)
    at Function.value (https://esm.sh/v131/[email protected]/deno/stream-chat.mjs:8:59543)
    at 

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

tayormi avatar Aug 20 '23 02:08 tayormi

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

rlee1990 avatar Aug 20 '23 18:08 rlee1990

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

Did you have any progress with this?

tkorsback avatar Sep 26 '23 17:09 tkorsback