PipedreamHQ / PipedreamHQ/pipedream-sdk-typescript

Browser createFrontendClient ignores projectId, causing connect-react calls to use /v1/connect//...

Open Beginner friendly
#347 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10
Forks
5
Avg merge
2d 22h
Merged PRs (30d)
2

Description

createFrontendClient from @pipedream/sdk/browser appears to ignore a configured projectId.

This looks related to #209 and #281, but the browser-specific client still hardcodes projectId: "".

Tested with:

  • @pipedream/sdk@3.0.7
  • @pipedream/connect-react@3.0.1

Reproduction:

import { createFrontendClient } from "@pipedream/sdk/browser";

const client = createFrontendClient({
  externalUserId: "user_123",
  projectEnvironment: "development",
  projectId: "proj_expected",
  tokenCallback: async () => ({
    token: "token",
    expiresAt: new Date(Date.now() + 60_000),
    connectLinkUrl: "",
  }),
});

console.log(client._options.projectId); // ""

Observed behavior:

connect-react calls such as client.accounts.list(...) and client.components.list(...) produce URLs like:

https://api.pipedream.com/v1/connect//accounts
https://api.pipedream.com/v1/connect//components

Expected behavior:

The browser client should preserve the configured projectId, or the docs should describe the supported browser-side way for connect-react account/component calls to resolve the project.

Relevant source on current main:

// src/browser/index.ts
super({
  baseUrl,
  projectEnvironment,
  projectId: "",
  tokenProvider,
  workflowDomain,
});

Additional local verification:

Even when passing projectId through public createFrontendClient options, a rendered ComponentForm still attempts account/component requests under /v1/connect//....

Previous related issue/PR:

  • #209
  • #281

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/browser/index.ts at the createFrontendClient super call, then reproduce the issue with the provided example and inspect the resulting accounts.list or components.list URLs. Done means a configured projectId is preserved for browser client requests, so connect-react calls no longer use /v1/connect//...; compare the behavior with related issues #209 and #281.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.