How to Resolve Pipedream Connection and API Integration Issues in Next.js Demo Project?

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

Issue: Clarification Needed on Pipedream Connection and API Integration

We are working on a demo project using Next.js and integrating the API, and I have encountered a few issues that I’d like to clarify. Below are the details:

  1. Connection Token vs API Key

Upon cloning the demo project and running it, I observed the following:

Could you please clarify the following:

  1. What is the purpose of the connection-token (ctok), and how should it be used in this flow?

  2. How can I fix this token issue to make the getAppInfo API work?

  3. Is the API key from the settings the preferred method? If yes, how can I retrieve this API key programmatically? (https://i.postimg.cc/zBbhf9tP/image.png)


2. OAuth and Authentication Flow

Using the client ID and secret from the API settings, I have successfully set up the authentication flow (https://i.postimg.cc/prZw71fq/image.png).

However, I need guidance on triggering events, such as when a user creates a sheet or schedules a meeting.

Could you please provide the following details:

  1. API documentation or examples on monitoring and handling these events programmatically. (https://i.postimg.cc/rp5QQZ2b/image.png)

Looking forward to hearing from Pipedream team!

About the API key vs Connect token, check out this section in the quickstart in our docs — the Connect token is a short-lived token that you use when actually initiating the account connection flow. After your end user connects their account, that token is no longer valid.

To make authenticated requests to Pipedream’s API, the recommended method is with a Pipedream OAuth client, which you must have already set up before generating the Connect token anyway. How are you making a request to the /apps endpoint? Via the SDK?

Today, if you’d like to run a workflow using your end user’s auth, it doesn’t currently work with triggers in the builder, you can however use your user’s auth in a code step or action.

Hi I faced this issue yesterday connection token is only for frontend to connect to the app. that’s it

To use /apps I used pipedream sdk, there is a method .makeAuthorizedRequest

Wow thanks! how you planning to use?

Unfortunately we cannot triggers for end users?

sorry I can’t help a lot
I know that to reproduce from CURL you should first do this

Then you get access token (NOT connect token!) and then use it for /apps

access token is a JWT.
I was also confused and tried to put connect token to Authorization header