File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
sources/platform/collaboration Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -196,32 +196,36 @@ The link will include a signature **only if the general resource access is set t
196196
197197You can generate pre-signed URLs programmatically for datasets and key-value stores:
198198
199+ - ** Dataset items**
199200``` js
200201import { ApifyClient } from " apify-client" ;
201202const client = new ApifyClient ({ token: process .env .APIFY_TOKEN });
202-
203- // Dataset items
204203const dataset = client .dataset (' my-dataset-id' );
205204
206205// Creates pre-signed URL for items (expires in 7 days)
207206const itemsUrl = await dataset .createItemsPublicUrl ({ expiresInSecs: 7 * 24 * 3600 });
208207
209208// Creates permanent pre-signed URL for items
210209const permanentItemsUrl = await dataset .createItemsPublicUrl ();
210+ ```
211211
212- // Key-value store
212+ - ** Key-value store list of keys**
213+ ``` js
213214const 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)
219217const keysPublicUrl = await store .createKeysPublicUrl ({ expiresInSecs: 24 * 3600 });
220218
221219// Create permanent pre-signed URL for list of keys
222220const 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
227231If the ` expiresInSecs ` option is not specified, the generated link will be ** permanent** .
You can’t perform that action at this time.
0 commit comments