-
Notifications
You must be signed in to change notification settings - Fork 2
Support configurable API version via EVERMEM_API_VERSION env var #7
Copy link
Copy link
Open
Description
Problem
The plugin has /api/v0/ hardcoded in three places inside hooks/scripts/utils/evermem-api.js:
| Line | Endpoint |
|---|---|
| 75 | GET /api/v0/memories/search |
| 169 | POST/DELETE /api/v0/memories |
| 256 | GET /api/v0/memories (with params) |
Users running self-hosted EverMemOS (or other deployments) that expose /api/v1/ cannot use the plugin without manually patching the file after every update.
Proposed fix
Add a getApiVersion() function to config.js that reads an optional EVERMEM_API_VERSION env var and defaults to 'v0' for full backwards compatibility:
// config.js
export function getApiVersion() {
return process.env.EVERMEM_API_VERSION || 'v0';
}
export function getConfig() {
return {
// ...existing fields...
apiVersion: getApiVersion(),
};
}Then replace the three hardcoded paths in evermem-api.js:
// Before
`${config.apiBaseUrl}/api/v0/memories/search`
// After
`${config.apiBaseUrl}/api/${config.apiVersion}/memories/search`Impact
- Zero breaking changes — default is
v0, existing installations are unaffected. - Self-hosted users just add
EVERMEM_API_VERSION=v1to their.envor environment.
Happy to submit a PR if you'd like!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels