Heuristic:Langgenius Dify Warning Deprecated Default Datasource Auth
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Data Sources, Deprecation |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Deprecation warning for the legacy useGetDefaultDataSourceListAuth hook in the data source service layer, which is marked for removal in a future version.
Description
The useGetDefaultDataSourceListAuth hook in web/service/use-datasource.ts fetches the default data source list using the legacy /api/data-source/integrates endpoint. A source code comment explicitly marks this hook as legacy and deprecated in the near future. The newer plugin-based data source authentication hooks (useGetDataSourceListAuth, useGetDataSourceAuth) should be used instead.
Usage
Use this warning when encountering calls to useGetDefaultDataSourceListAuth or useInvalidDefaultDataSourceListAuth. These should be migrated to the plugin-based equivalents (useGetDataSourceListAuth, useGetDataSourceAuth) before the legacy API endpoint is removed.
The Insight (Rule of Thumb)
- Action: Replace
useGetDefaultDataSourceListAuthwithuseGetDataSourceListAuthin all consuming components. - Value: The new hooks use the plugin-based data source API which supports per-provider credential management and OAuth flows.
- Trade-off: Migration requires updating components that rely on the default flat list to use the plugin-scoped credential model instead.
Reasoning
The Dify data source system has been migrated from a monolithic default integration model to a plugin-based architecture. The old endpoint (/api/data-source/integrates) serves a flat list of all connected data sources, while the new plugin-based endpoints support per-provider scoping and richer credential management. The legacy hook remains for backward compatibility but will be removed once all consumers are migrated.