📚 docs: Update Custom Endpoint docs with new user placeholder features for headers (#338)

This commit is contained in:
Dustin Healy
2025-07-07 08:19:54 -07:00
committed by GitHub
parent 8907e43abc
commit 8a4376fc17
2 changed files with 30 additions and 2 deletions

View File

@@ -15,4 +15,7 @@
- Allows users to securely provide their own API keys and credentials for MCP servers
- Configurable through UI via settings icon in tool selection or MCP Settings panel
- Ensures authentication details remain private in multi-user environments
- See: [MCP Servers Object Structure - customUserVars](/docs/configuration/librechat_yaml/object_structure/mcp_servers#customuservars)
- See: [MCP Servers Object Structure - customUserVars](/docs/configuration/librechat_yaml/object_structure/mcp_servers#customuservars)
- Added user placeholder variables support to Custom Endpoint Headers:
- Users can now use `{{LIBRECHAT_USER_ID}}`, `{{LIBRECHAT_USER_EMAIL}}`, and other user field placeholders in custom endpoint headers
- See: [Custom Endpoint Object Structure - Headers](/docs/configuration/librechat_yaml/object_structure/custom_endpoint#headers) for details

View File

@@ -346,7 +346,7 @@ dropParams:
**Key:**
<OptionTable
options={[
['headers', 'Object/Dictionary', 'Adds additional headers to requests. Can reference an environment variable', 'The `headers` object specifies custom headers for requests. Useful for authentication and setting content types.'],
['headers', 'Object/Dictionary', 'Adds additional headers to requests. Supports dynamic user field substitution with `{{LIBRECHAT_USER_*}}` placeholders and environment variables with `${ENV_VAR}`.', 'The `headers` object specifies custom headers for requests. Useful for authentication and setting content types.'],
]}
/>
@@ -355,9 +355,34 @@ dropParams:
headers:
x-api-key: "${ENVIRONMENT_VARIABLE}"
Content-Type: "application/json"
X-User-ID: "{{LIBRECHAT_USER_ID}}"
X-User-Email: "{{LIBRECHAT_USER_EMAIL}}"
```
**Note:** Supports dynamic environment variable values, which use the format: `"${VARIABLE_NAME}"`.
**Available User Field Placeholders:**
| Placeholder | User Field | Type | Description |
|------------|------------|------|-------------|
| `{{LIBRECHAT_USER_ID}}` | `id` | String | User's unique identifier |
| `{{LIBRECHAT_USER_NAME}}` | `name` | String | User's display name |
| `{{LIBRECHAT_USER_USERNAME}}` | `username` | String | User's username |
| `{{LIBRECHAT_USER_EMAIL}}` | `email` | String | User's email address |
| `{{LIBRECHAT_USER_PROVIDER}}` | `provider` | String | Authentication provider (e.g., "email", "google", "github") |
| `{{LIBRECHAT_USER_ROLE}}` | `role` | String | User's role (e.g., "user", "admin") |
| `{{LIBRECHAT_USER_GOOGLEID}}` | `googleId` | String | Google account ID |
| `{{LIBRECHAT_USER_FACEBOOKID}}` | `facebookId` | String | Facebook account ID |
| `{{LIBRECHAT_USER_OPENIDID}}` | `openidId` | String | OpenID account ID |
| `{{LIBRECHAT_USER_SAMLID}}` | `samlId` | String | SAML account ID |
| `{{LIBRECHAT_USER_LDAPID}}` | `ldapId` | String | LDAP account ID |
| `{{LIBRECHAT_USER_GITHUBID}}` | `githubId` | String | GitHub account ID |
| `{{LIBRECHAT_USER_DISCORDID}}` | `discordId` | String | Discord account ID |
| `{{LIBRECHAT_USER_APPLEID}}` | `appleId` | String | Apple account ID |
| `{{LIBRECHAT_USER_EMAILVERIFIED}}` | `emailVerified` | Boolean → String | Email verification status ("true" or "false") |
| `{{LIBRECHAT_USER_TWOFACTORENABLED}}` | `twoFactorEnabled` | Boolean → String | 2FA status ("true" or "false") |
| `{{LIBRECHAT_USER_TERMSACCEPTED}}` | `termsAccepted` | Boolean → String | Terms acceptance status ("true" or "false") |
## directEndpoint
**Key:**