Skip to content

Commit e90ba12

Browse files
committed
chore: improve docs
1 parent 57e2bbb commit e90ba12

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,32 +196,36 @@ The link will include a signature **only if the general resource access is set t
196196

197197
You can generate pre-signed URLs programmatically for datasets and key-value stores:
198198

199+
- **Dataset items**
199200
```js
200201
import { ApifyClient } from "apify-client";
201202
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
202-
203-
// Dataset items
204203
const dataset = client.dataset('my-dataset-id');
205204

206205
// Creates pre-signed URL for items (expires in 7 days)
207206
const itemsUrl = await dataset.createItemsPublicUrl({ expiresInSecs: 7 * 24 * 3600 });
208207

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

212-
// Key-value store
212+
- **Key-value store list of keys**
213+
```js
213214
const store = client.keyValueStore('my-store-id');
214215

215-
// Get permanent URL for a single record
216-
const recordUrl = store.getRecordPublicUrl('report.pdf');
217-
218216
// Create pre-signed URL for list of keys (expires in 1 day)
219217
const keysPublicUrl = await store.createKeysPublicUrl({ expiresInSecs: 24 * 3600 });
220218

221219
// Create permanent pre-signed URL for list of keys
222220
const permanentKeysPublicUrl = await store.createKeysPublicUrl();
223221
```
224222

223+
- **Key-value store list of keys**
224+
```js
225+
// Get permanent URL for a single record
226+
const recordUrl = store.getRecordPublicUrl('report.pdf');
227+
```
228+
225229
:::tip Permanent signed URL
226230

227231
If the `expiresInSecs` option is not specified, the generated link will be **permanent**.

0 commit comments

Comments
 (0)