Why Do I Keep Receiving an 'External User Id Missing' Error Despite Following the Official Pipeline Documentation?

This topic was automatically generated from Slack. You can find the original thread here.

Why everytime i do something like this, I will get external user id missing error? Isn’t this the official pipeline documentation suggested implementation as in Connect API Proxy - Pipedream?

Could you help me and @U03CXTHK4RF

have you passed the external user id as instructed in the doc?

Yes, I have, but that is on later stage where I run the proxy .post request. But when initiing the client, I don’t

And it seems like it is stucked at initing the client, not passing to next stage for proxy post

Okay, this seems weird. I’ll check with the team and get back to you.

ok thank you

but strange tho, I can do things like this

Is it because there is some syntax confusion? I feel like this is a different object from the first client

Hm I’m a little confused on the implementation. Are you initializing the client from the frontend? What version of the SDK?

Let me check hold on

2.0.7 sdk

initialized from frontend

Oh, you need to initialize that client in your server. Weird error though.

import { PipedreamClient } from "@pipedream/sdk";
      const client = new PipedreamClient({
        externalUserId: user?.id,
        tokenCallback: () => connectToken,
      }); 

This does work

But this doesn’t work

import { PipedreamClient } from "@pipedream/sdk";

const pdclient = new PipedreamClient({
  clientId: process.env.PIPEDREAM_CLIENT_ID,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET,
  projectId: process.env.PIPEDREAM_PROJECT_ID,
  projectEnvironment: "development",
});

Yea I think that’s expected, you definitely don’t want to expose your Pipedream credentials to your frontend. https://pipedream.com/docs/connect/api-reference/sdks#browser-usage

I seee.

Well I do have this in my flask backend. SO i guess i need to make another endpoint, and for each query, like checking whether a user has connected to an app, my frontend need to call my backend endpoint to retrieve that info right?