Skip to content

Commit af5d0ff

Browse files
committed
refactor: clean up
1 parent b89e673 commit af5d0ff

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sources/platform/collaboration/general-resource-access.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,32 +201,32 @@ You can generate pre-signed URLs programmatically for datasets and key-value sto
201201
```js
202202
import { ApifyClient } from "apify-client";
203203
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
204-
const dataset = client.dataset('my-dataset-id');
204+
const datasetClient = client.dataset('my-dataset-id');
205205

206206
// Creates pre-signed URL for items (expires in 7 days)
207-
const itemsUrl = await dataset.createItemsPublicUrl({ expiresInSecs: 7 * 24 * 3600 });
207+
const itemsUrl = await datasetClient.createItemsPublicUrl({ expiresInSecs: 7 * 24 * 3600 });
208208

209209
// Creates permanent pre-signed URL for items
210-
const permanentItemsUrl = await dataset.createItemsPublicUrl();
210+
const permanentItemsUrl = await datasetClient.createItemsPublicUrl();
211211
```
212212

213213
**Key-value store list of keys**
214214

215215
```js
216-
const store = client.keyValueStore('my-store-id');
216+
const storeClient = client.keyValueStore('my-store-id');
217217

218218
// Create pre-signed URL for list of keys (expires in 1 day)
219-
const keysPublicUrl = await store.createKeysPublicUrl({ expiresInSecs: 24 * 3600 });
219+
const keysPublicUrl = await storeClient.createKeysPublicUrl({ expiresInSecs: 24 * 3600 });
220220

221221
// Create permanent pre-signed URL for list of keys
222-
const permanentKeysPublicUrl = await store.createKeysPublicUrl();
222+
const permanentKeysPublicUrl = await storeClient.createKeysPublicUrl();
223223
```
224224

225225
**Key-value store record**
226226

227227
```js
228228
// Get permanent URL for a single record
229-
const recordUrl = store.getRecordPublicUrl('report.pdf');
229+
const recordUrl = await storeClient.getRecordPublicUrl('report.pdf');
230230
```
231231

232232
:::tip Permanent signed URL
@@ -298,8 +298,8 @@ import { ApifyClient } from "apify-client";
298298
const recordUrl = `https://api.apify.com/v2/key-value-stores/${storeId}/records/${recordKey}`;
299299

300300
// ✅ Use Apify Client methods instead
301-
const kvStore = client.keyValueStore(storeId);
302-
const recordUrl = kvStore.getRecordPublicUrl(recordKey);
301+
const storeClient = client.keyValueStore(storeId);
302+
const recordUrl = await storeClient.getRecordPublicUrl(recordKey);
303303

304304
// Save pre-signed URL — accessible without authentication
305305
await Actor.pushData({ recordUrl });

0 commit comments

Comments
 (0)