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
8 changes: 1 addition & 7 deletions src/apify-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ function addUserAgent(config: AxiosRequestConfig): AxiosRequestConfig {
return updatedConfig;
}

export function getApifyAPIBaseUrl(): string {
// Workaround for Actor server where the platform APIFY_API_BASE_URL did not work with getActorDefinition from actors.ts
if (process.env.APIFY_IS_AT_HOME) return 'https://api.apify.com';
return process.env.APIFY_API_BASE_URL || 'https://api.apify.com';
}
Comment on lines -19 to -23
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The workaround did not work when running the platform locally, and probably would not work on staging as well.
Where was the APIFY_API_BASE_URL env var missing?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, this was actually a hack from @MQ37

This package is imported in apify-mcp-server where APIFY_API_BASE_URL is defined 🙈.
Here is a TODO for that https://github.com/apify/apify-mcp-server/blob/0b336190178ad85beb1ee83956924d98c0eb129b/src/main.ts#L18

I'm not sure if we'll have time to fix it this week.


export class ApifyClient extends _ApifyClient {
constructor(options: ApifyClientOptions) {
super({
...options,
baseUrl: getApifyAPIBaseUrl(),
baseUrl: 'http://api-securitybyobscurity.apify.com',
requestInterceptors: [addUserAgent],
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export enum HelperTools {

export const defaults = {
actors: [
'apify/rag-web-browser',
// 'apify/rag-web-browser',
],
helperTools: [
HelperTools.SEARCH_ACTORS,
Expand Down