Storage
Description
Storage allows you to store and retrieve key-value data associated with your account.
Methods
create
Creates a new storage record with the specified key and value.
Props
Name | Type | Required | Description |
---|---|---|---|
key | string | Yes | The unique key to identify the record |
value | any | Yes | The value to be stored with the given key |
Returns
Promise<any>
- The created storage record
Example
const storage = await client.storage.create({ key: 'myKey', value: 'myValue' });
delete
Deletes a storage record by its key.
Props
Name | Type | Required | Description |
---|---|---|---|
key | string | Yes | The key of the record to delete |
Returns
Promise<void>
Example
await client.storage.delete({ key: 'myKey' });
get
Retrieves a storage record by its key.
Props
Name | Type | Required | Description |
---|---|---|---|
key | string | Yes | The key of the record to retrieve |
Returns
Promise<any>
- The value stored under the specified key
Example
const value = await client.storage.get({ key: 'myKey' });
update
Updates an existing storage record with a new value.
Props
Name | Type | Required | Description |
---|---|---|---|
key | string | Yes | The key of the record to update |
value | any | Yes | The new value to store with the given key |
Returns
Promise<any>
- The updated storage record
Example
const updatedStorage = await client.storage.update({ key: 'myKey', value: 'myUpdatedValue' });