Implementation:Infiniflow Ragflow UseUserSettingRequest Hooks
| Knowledge Sources | |
|---|---|
| Domains | Frontend, React_Hooks, User_Settings |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete React Query hooks for user settings operations including profile management, LLM provider configuration, and system model settings in the RAGFlow frontend.
Description
The use-user-setting-request.tsx module provides hooks for: fetching user profile and tenant info, updating user settings, managing LLM API keys, configuring system model defaults, and handling tenant-level configuration. These hooks power the entire user settings page.
Usage
Import these hooks in user settings pages, profile management views, and LLM provider configuration forms.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/hooks/use-user-setting-request.tsx
- Lines: 1-487
Signature
export function useFetchUserInfo(): UseQueryResult;
export function useUpdateUserSetting(): UseMutationResult;
export function useSaveLlmApiKey(): UseMutationResult;
export function useSetSystemModel(): UseMutationResult;
export function useFetchTenantInfo(): UseQueryResult;
Import
import { useFetchUserInfo, useSaveLlmApiKey } from '@/hooks/use-user-setting-request';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Hooks consume auth context internally |
Outputs
| Name | Type | Description |
|---|---|---|
| useFetchUserInfo() | UseQueryResult | User profile and settings data |
| useSaveLlmApiKey() | UseMutationResult | LLM API key save mutation |
Usage Examples
import { useFetchUserInfo, useUpdateUserSetting } from '@/hooks/use-user-setting-request';
function ProfilePage() {
const { data: userInfo } = useFetchUserInfo();
const { mutate: updateSettings } = useUpdateUserSetting();
// ...
}