Skip to content

Public resource URLs shouldn't refer to base API URL #744

@barjin

Description

@barjin

Running the following code on Platform:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    baseUrl: process.env['APIFY_API_BASE_URL'],
    token: process.env['APIFY_TOKEN'],
});

const kvs = await client.keyValueStore(process.env['APIFY_DEFAULT_KEY_VALUE_STORE_ID']);
const publicUrl = await kvs.getRecordPublicUrl('key');

console.log(publicUrl);

Leads to this:

Image

Platform sets the APIFY_API_BASE_URL to an internal address to simplify communication between the Actors and Apify Platform internals. This shouldn't be used when constructing the public resource URLs (in methods like KVS.getPublicRecordUrl and similar).

closes apify/apify-sdk-js#460

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions