Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ For single-tenant mode, configure environment variables:
|----------|-------------|----------|
| KONTENT_API_KEY | Your Kontent.ai Management API key | ✅ |
| KONTENT_ENVIRONMENT_ID | Your environment ID | ✅ |
| KONTENT_MANAGE_API_URL | Kontent.ai Management API URL (defaults to https://manage.kontent.ai/) | ❌ |
| PORT | Port for HTTP transport (defaults to 3001) | ❌ |

### Multi-Tenant Mode
Expand Down
5 changes: 4 additions & 1 deletion src/clients/kontentClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const createMapiClient = (
...(additionalHeaders || []),
];

const manageApiUrl =
config?.manageApiUrl ?? process.env.KONTENT_MANAGE_API_URL;

return createManagementClient({
apiKey:
apiKey ??
Expand All @@ -36,7 +39,7 @@ export const createMapiClient = (
environmentId ??
process.env.KONTENT_ENVIRONMENT_ID ??
throwError("KONTENT_ENVIRONMENT_ID is not set"),
baseUrl: config ? `${config.manageApiUrl}v2` : undefined,
headers: allHeaders,
baseUrl: manageApiUrl && `${manageApiUrl}v2`,
});
};