Skip to main content
Version: Next

KeyValueStoreClient

Hierarchy

  • ResourceClient
    • KeyValueStoreClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

createKeysPublicUrl

  • createKeysPublicUrl(options, expiresInMillis): Promise<string>
  • Generates a URL that can be used to access key-value store keys.

    If the client has permission to access the key-value store's URL signing key, the URL will include a signature to verify its authenticity.

    You can optionally control how long the signed URL should be valid using the expiresInMillis option. This value sets the expiration duration in milliseconds from the time the URL is generated. If not provided, the URL will not expire.

    Any other options (like limit or prefix) will be included as query parameters in the URL.


    Parameters

    Returns Promise<string>

delete

  • delete(): Promise<void>

deleteRecord

  • deleteRecord(key): Promise<void>

get

getRecord

  • You can use the buffer option to get the value in a Buffer (Node.js) or ArrayBuffer (browser) format. In Node.js (not in browser) you can also use the stream option to get a Readable stream.

    When the record does not exist, the function resolves to undefined. It does NOT resolve to a KeyValueStore record with an undefined value. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record


    Parameters

    • key: string

    Returns Promise<undefined | KeyValueStoreRecord<JsonValue>>

listKeys

recordExists

  • recordExists(key): Promise<boolean>

setRecord

  • setRecord(record, options): Promise<void>

update