@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Create a key-value storage entry Creates a new key-value storage entry for the target user under the given key. The key must not already exist for this user; use the upsert endpoint to create or overwrite in a single call. End-user (user-JWT) callers always write to their own storage. Developer and server-to-server callers must supply a user param identifying the target user within their app's scope. Attempting to write for a user in a different app returns 404.

      Parameters

      • input: { key: string; user?: string; value: string }

        Request body.

        • key: string

          Storage key for the entry. Must be a non-empty string unique to this user.

        • Optionaluser?: string

          Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.

        • value: string

          Value to store under key. Must be a non-empty string.

      Returns Promise<KeyValueStorageEntry>

      The newly created key-value storage entry.

    • Delete a key-value storage entry Permanently deletes the key-value storage entry identified by key for the target user. Returns 204 No Content on success and 404 if the entry does not exist. End-user (user-JWT) callers can only delete entries they own. Developer and server-to-server callers must supply a user param identifying the target user within their app's scope.

      Parameters

      • key: string

        Storage key of the entry to delete. Must be a non-empty string.

      Returns Promise<void>

      Empty response body. HTTP 204 No Content on success.

    • Retrieve a key-value storage entry Returns the key-value storage entry identified by key for the target user. Returns 404 if no entry exists for that key. End-user (user-JWT) callers retrieve entries from their own storage. Developer and server-to-server callers must supply a user param identifying the target user within their app's scope.

      Parameters

      • key: string

        Storage key of the entry to retrieve. Must be a non-empty string.

      • Optionalparams: { user?: string }

        Query parameters.

        • Optionaluser?: string

          Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.

      Returns Promise<KeyValueStorageEntry>

      The key-value storage entry for the given key.

    • List key-value storage entries Returns key-value storage entries in one of two modes depending on the caller's auth scope. User-JWT callers receive a flat list of all their own entries with no pagination fields. The page, page_size, user, user_search, and key params are ignored. Developer and server-to-server callers receive a page-based paginated response across all users within the caller's app. Use user to scope results to a single user, user_search to do a substring match on email or full name, and key to filter entries whose key starts with the given prefix. Results are ordered by creation time descending.

      Parameters

      • Optionalparams: {
            key?: string;
            page?: number;
            pageSize?: number;
            user?: string;
            userSearch?: string;
        }

        Query parameters.

        • Optionalkey?: string

          Prefix filter on the storage key. Returns only entries whose key starts with this string. Applies to developer and server-to-server callers only.

        • Optionalpage?: number

          Page number to retrieve. Applies to developer and server-to-server callers only. Defaults to 1.

        • OptionalpageSize?: number

          Number of entries per page. Applies to developer and server-to-server callers only. Defaults to 25; maximum is 100.

        • Optionaluser?: string

          Filter results to entries belonging to this user ID. Applies to developer and server-to-server callers only.

        • OptionaluserSearch?: string

          Substring match against user email address and full name. Applies to developer and server-to-server callers only.

      Returns Promise<KeyValueStorageEntryPage>

      Key-value storage entries for the current page, with pagination metadata for developer and server-to-server callers.

    • Create or update a key-value storage entry Creates a new key-value storage entry for the given key, or overwrites the value if an entry already exists. This is the idempotent alternative to the create endpoint: safe to call regardless of whether the key already exists. End-user (user-JWT) callers always write to their own storage. Developer and server-to-server callers must supply a user param identifying the target user within their app's scope. Attempting to write for a user in a different app returns 404.

      Parameters

      • key: string

        Storage key to create or overwrite. Must be a non-empty string.

      • input: { user?: string; value: string }

        Request body.

        • Optionaluser?: string

          Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.

        • value: string

          New value to store under key. Must be a non-empty string. Replaces any existing value.

      Returns Promise<KeyValueStorageEntry>

      The created or updated key-value storage entry.