Skip to content

Conversation

danpoletaev
Copy link
Contributor

This PR updates general resource access documentation, more specifically:

Closes https://github.com/apify/apify-core/issues/23249

@danpoletaev danpoletaev self-assigned this Oct 7, 2025
@danpoletaev danpoletaev requested a review from TC-MO as a code owner October 7, 2025 14:53
@github-actions github-actions bot added the t-core-services Issues with this label are in the ownership of the core services team. label Oct 7, 2025
@apify-service-account
Copy link

Preview for this PR was built for commit f72ff286 and is ready at https://pr-1988.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit aaf52734 and is ready at https://pr-1988.preview.docs.apify.com!

@danpoletaev danpoletaev requested a review from raethlo October 8, 2025 08:27
@apify-service-account
Copy link

Preview for this PR was built for commit 992f083d and is ready at https://pr-1988.preview.docs.apify.com!

Copy link
Contributor

@raethlo raethlo left a comment

Choose a reason for hiding this comment

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

Content-wise looks good, but I'd consider updating the structure to make it easier to read (comments below) and cut bits here and there for brevity.

@apify-service-account
Copy link

Preview for this PR was built for commit 57f3c965 and is ready at https://pr-1988.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit fe6b89e0 and is ready at https://pr-1988.preview.docs.apify.com!

@danpoletaev danpoletaev requested a review from tobice October 13, 2025 07:19
@tobice
Copy link
Contributor

tobice commented Oct 13, 2025

I'm aware of the PR, will take a look ~tomorrow 🎗️

Copy link
Contributor

@tobice tobice left a comment

Choose a reason for hiding this comment

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

Looks great, just a few nits I noticed 👍


You can create pre-signed URLs either through the Apify Console or programmatically via the Apify API client.

#### How to generate pre-signed URLs in Apify Console
Copy link
Contributor

@tobice tobice Oct 14, 2025

Choose a reason for hiding this comment

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

(general comment)

@raethlo This is essentially... you know... sharing 😄

It's just weird that we have a share modal, and then an export modal, and they both do kind of the same thing. It would totally make sense to somehow integrate it: If you want to share a storage, you should be able to generate a pre-signed link with just content from there.

I have a vague feeling that this has been already brought up somewhere... 🤔

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I agree completely, we may have talked about it too when I was writing the previous iteration of docs, I think from UX standpoint we should def combine export/sharing.

@danpoletaev danpoletaev requested a review from raethlo October 14, 2025 08:32
@apify-service-account
Copy link

Preview for this PR was built for commit 30801e58 and is ready at https://pr-1988.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit b89e6736 and is ready at https://pr-1988.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit af5d0ffc and is ready at https://pr-1988.preview.docs.apify.com!

Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

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

Few changes requested, generally speaking our style guide calls for bold to be reserved for UI elements, and italics to be used for emphasis


#### What links can be pre-signed

Only selected **dataset** and **key-value store** endpoints support pre-signed URLs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Only selected **dataset** and **key-value store** endpoints support pre-signed URLs.
Only selected _dataset_ and _key-value store_ endpoints support pre-signed URLs.

Comment on lines 144 to 147
| **Datasets** | [Dataset items](/api/v2/dataset-items-get) (`/v2/datasets/:datasetId/items`) | Temporary or Permanent | The link provides access to all dataset items. |
| **Key-value stores** | [List of keys](/api/v2/key-value-store-keys-get) (`/v2/key-value-stores/:storeId/keys`) | Temporary or Permanent | Returns the list of keys in a store. |
| **Key-value stores** | [Single record](/api/v2/key-value-store-record-get) (`/v2/key-value-stores/:storeId/records/:recordKey`) | **Permanent only** | The public URL for a specific record is always permanent - it stays valid as long as the record exists. |

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **Datasets** | [Dataset items](/api/v2/dataset-items-get) (`/v2/datasets/:datasetId/items`) | Temporary or Permanent | The link provides access to all dataset items. |
| **Key-value stores** | [List of keys](/api/v2/key-value-store-keys-get) (`/v2/key-value-stores/:storeId/keys`) | Temporary or Permanent | Returns the list of keys in a store. |
| **Key-value stores** | [Single record](/api/v2/key-value-store-record-get) (`/v2/key-value-stores/:storeId/records/:recordKey`) | **Permanent only** | The public URL for a specific record is always permanent - it stays valid as long as the record exists. |
| _Datasets_ | [Dataset items](/api/v2/dataset-items-get) (`/v2/datasets/:datasetId/items`) | Temporary or Permanent | The link provides access to all dataset items. |
| _Key-value stores_ | [List of keys](/api/v2/key-value-store-keys-get) (`/v2/key-value-stores/:storeId/keys`) | Temporary or Permanent | Returns the list of keys in a store. |
| _Key-value stores_ | [Single record](/api/v2/key-value-store-record-get) (`/v2/key-value-stores/:storeId/records/:recordKey`) | _Permanent only_ | The public URL for a specific record is always permanent - it stays valid as long as the record exists. |

- `itemsPublicUrl` – a pre-signed URL providing access to dataset items
- `keysPublicUrl` – a pre-signed URL providing access to key-value store keys

These automatically generated URLs are **valid for 14 days**.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
These automatically generated URLs are **valid for 14 days**.
These automatically generated URLs are _valid for 14 days_.

:::note

To generate a pre-signed link, you can use the **Export** button in Console, or call the appropriate API client method.
The link will include a signature **only if the general resource access is set to Restricted**. For unrestricted datasets, the link will work without a signature.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The link will include a signature **only if the general resource access is set to Restricted**. For unrestricted datasets, the link will work without a signature.
The link will include a signature _only if the general resource access is set to Restricted_. For unrestricted datasets, the link will work without a signature.


:::

**Dataset items:**
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be H5?


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

**Dataset items**
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be H5?

const permanentItemsUrl = await datasetClient.createItemsPublicUrl();
```

**Key-value store list of keys**
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be H5?

const permanentKeysPublicUrl = await storeClient.createKeysPublicUrl();
```

**Key-value store record**
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be H5?


If you need finer control — for example, generating links without using Apify client — you can sign URLs manually using our reference implementation.

👉 [See reference implementation in Apify clients](https://github.com/apify/apify-client-js/blob/5efd68a3bc78c0173a62775f79425fad78f0e6d1/src/resource_clients/dataset.ts#L179)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try to minimize emoji usage

Suggested change
👉 [See reference implementation in Apify clients](https://github.com/apify/apify-client-js/blob/5efd68a3bc78c0173a62775f79425fad78f0e6d1/src/resource_clients/dataset.ts#L179)
[Check the reference implementation in Apify clients](https://github.com/apify/apify-client-js/blob/5efd68a3bc78c0173a62775f79425fad78f0e6d1/src/resource_clients/dataset.ts#L179)


👉 [See reference implementation in Apify clients](https://github.com/apify/apify-client-js/blob/5efd68a3bc78c0173a62775f79425fad78f0e6d1/src/resource_clients/dataset.ts#L179)

Manual signing uses standard **HMAC (SHA-256)** with `urlSigningSecretKey` of the resource and can be easily integrated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Manual signing uses standard **HMAC (SHA-256)** with `urlSigningSecretKey` of the resource and can be easily integrated.
Manual signing uses standard _HMAC (SHA-256)_ with `urlSigningSecretKey` of the resource and can be easily integrated.

@danpoletaev danpoletaev requested a review from TC-MO October 15, 2025 13:26
@danpoletaev
Copy link
Contributor Author

@TC-MO Lint is failing on the files I've never touched. I tried to merge master hoping that it was resolved, but it wasn't. Can you, please, fix it or let me know if I should fix it?

@apify-service-account
Copy link

Preview for this PR was built for commit 49d39ee1 and is ready at https://pr-1988.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 6057eed0 and is ready at https://pr-1988.preview.docs.apify.com!

@TC-MO
Copy link
Contributor

TC-MO commented Oct 15, 2025

Just FYI the files were touched, but that may have been done by the linter? Otherwise neither markdownlint nor vale would touch them as they are set up to only check changed files during PR checks, I'll take a look at what is the issue and fix it in about an hour :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-core-services Issues with this label are in the ownership of the core services team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants