@pipedream/connect-react 1.3.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/dist/connect-react.es.js +1774 -1767
- package/dist/connect-react.umd.d.ts +12 -1
- package/dist/connect-react.umd.js +10 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -153,9 +153,64 @@ type ComponentFormProps = {
|
|
|
153
153
|
sdkResponse: unknown[] | unknown | undefined;
|
|
154
154
|
/** Whether to show show errors in the form. Requires sdkErrors to be set. */
|
|
155
155
|
enableDebugging?: boolean;
|
|
156
|
+
/** OAuth app ID configuration for specific apps.
|
|
157
|
+
* Maps app name slugs to their corresponding OAuth app IDs. */
|
|
158
|
+
oauthAppConfig?: Record<string, string>;
|
|
156
159
|
};
|
|
157
160
|
```
|
|
158
161
|
|
|
162
|
+
### OAuth App Configuration
|
|
163
|
+
|
|
164
|
+
To connect to an OAuth app using your own OAuth client, you can specify custom OAuth app IDs for each app using the `oauthAppConfig` prop:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
const oauthAppConfig = {
|
|
168
|
+
github: "oa_xxxxxxx",
|
|
169
|
+
google_sheets: "oa_xxxxxxx",
|
|
170
|
+
slack: "oa_xxxxxxx",
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
<ComponentFormContainer
|
|
174
|
+
userId={userId}
|
|
175
|
+
componentKey="slack-send-message-to-channel"
|
|
176
|
+
configuredProps={configuredProps}
|
|
177
|
+
onUpdateConfiguredProps={setConfiguredProps}
|
|
178
|
+
oauthAppConfig={oauthAppConfig}
|
|
179
|
+
/>;
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
This allows you to use your own OAuth applications for specific integrations, providing better control over branding and permissions. Read how to configure OAuth clients in Pipedream here: [https://pipedream.com/docs/connect/managed-auth/oauth-clients](https://pipedream.com/docs/connect/managed-auth/oauth-clients).
|
|
183
|
+
|
|
184
|
+
**Note**: OAuth app IDs are not sensitive, and are safe to expose in the client.
|
|
185
|
+
|
|
186
|
+
### App Sorting and Filtering
|
|
187
|
+
|
|
188
|
+
When using the `SelectApp` component or `useApps` hook, you can control how apps are sorted and filtered:
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
<SelectApp
|
|
192
|
+
value={selectedApp}
|
|
193
|
+
onChange={setSelectedApp}
|
|
194
|
+
appsOptions={{
|
|
195
|
+
sortKey: "featured_weight", // Sort by: "name" | "featured_weight" | "name_slug"
|
|
196
|
+
sortDirection: "desc", // "asc" | "desc"
|
|
197
|
+
hasActions: true, // Only show apps with actions
|
|
198
|
+
hasTriggers: false, // Exclude apps with triggers
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The `useApps` hook accepts the same options:
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
const { apps, isLoading } = useApps({
|
|
207
|
+
q: "slack", // Search query
|
|
208
|
+
sortKey: "featured_weight",
|
|
209
|
+
sortDirection: "desc",
|
|
210
|
+
hasActions: true,
|
|
211
|
+
});
|
|
212
|
+
```
|
|
213
|
+
|
|
159
214
|
## Customization
|
|
160
215
|
|
|
161
216
|
Style individual components using the `CustomizeProvider` and a `CustomizationConfig`.
|
|
@@ -164,7 +219,7 @@ Style individual components using the `CustomizeProvider` and a `CustomizationCo
|
|
|
164
219
|
<FrontendClientProvider client={client}>
|
|
165
220
|
<CustomizeProvider {...customizationConfig}>
|
|
166
221
|
<ComponentFormContainer
|
|
167
|
-
key="slack-send-message"
|
|
222
|
+
key="slack-send-message-to-channel"
|
|
168
223
|
configuredProps={configuredProps}
|
|
169
224
|
onUpdateConfiguredProps={setConfiguredProps}
|
|
170
225
|
/>
|
|
@@ -427,7 +482,7 @@ customization options available.
|
|
|
427
482
|
- `useFrontendClient` — _allows use of provided Pipedream frontendClient_
|
|
428
483
|
- `useAccounts` — _react-query wrapper to list Pipedream connect accounts (for app, external user, etc.)_
|
|
429
484
|
- `useApp` — _react-query wrapper to retrieve a Pipedream app_
|
|
430
|
-
- `useApps` — _react-query wrapper to list Pipedream
|
|
485
|
+
- `useApps` — _react-query wrapper to list Pipedream apps with support for sorting and filtering_
|
|
431
486
|
- `useComponent` — _react-query wrapper to retrieve a Pipedream component (action or trigger)_
|
|
432
487
|
- `useComponents` — _react-query wrapper to list Pipedream components (actions or triggers)_
|
|
433
488
|
|