ByteChef Embedded, Part 1: Let Your Users Connect Their Apps
Описание и применение
ByteChef Embedded позволяет SaaS‑приложениям подключать аккаунты пользователей без реализации OAuth для каждого провайдера, используя JWT и один хук useConnectDialog.
Задача
Embedding automation requires users to connect their own accounts, which normally means building and maintaining OAuth flows for each provider.
Результат
By delegating OAuth, credential storage, and token refresh to ByteChef, developers reduce complexity, improve security, and accelerate feature delivery.
Рабочий процесс
- 1. Backend signs a JWT containing the external user ID and name using ByteChef private key.
- 2. Frontend fetches the JWT via /api/token endpoint.
- 3. Frontend calls useConnectDialog({baseUrl, environment, integrationId, jwtToken}) and invokes openDialog().
- 4. ByteChef mounts ConnectDialog which runs provider OAuth or API‑key flow, stores credentials securely, and refreshes tokens.
- 5. After connection, the same dialog can be opened in manage mode to toggle workflows, edit inputs, or disconnect.
- 6. Frontend refreshes integration list when dialog closes.
Доказательства
ByteChef Embedded makes that a two‑piece job: (1) your backend signs a JWT identifying one of your users as a ByteChef connected user, and (2) your frontend calls one hook – useConnectDialog – which mounts a hosted ConnectDialog that runs the whole OAuth/API‑key handshake, stores and refreshes the credentials, and doubles as the manage surface once a connection exists.
The dialog owns its own lifecycle, so its closing is something you observe rather than subscribe to: the hook hands back openDialog and closeDialog, and the sample app watches the #connect-dialog-portal node empty out to know when to refresh its list.
- Дата записи: 2026-09-20T09:45:25.017Z