utils API
kv public
0
Node
JavaScript
Python beta
Ruby beta
Shell
curl
Hey! Want to build awesome, scalable APIs like this one?
Sign up with Standard Library today and build your own API or connect to others in seconds.
We hope you enjoy documentation for the utils kv API on Standard Library! This API can be used via the command line (shell), Node, Ruby, Python or as a generic HTTP call in any language. Check the code examples on the right associated with each API method for how to use this API in your language of choice.
API Description
Key-Value Store Service.
# API Documentation This is a highly available backend key-value storage service. All keys are converted to strings, and values must be JSON-serializable. Your storage is scoped to the active StdLib user account based on the Library Token you used to authenticate. ## Usage You **must** be authenticated with a StdLib Library Token to use this service. You can do that by initializing `lib` like this: ```javascript const kv = require('lib')({token: STDLIB_LIBRARY_TOKEN}).utils.kv; ``` If specifying a table when using utils.kv can be done two ways. The first is on a per function call basis: ```javascript const kv = require('lib')({token: STDLIB_LIBRARY_TOKEN}).utils.kv; await kv.set({ table: 'table_name', key: 'key', value: 'value' }); ``` The second will set the table for all function calls from within a service: ```javascript const kv = require('lib')({token: STDLIB_LIBRARY_TOKEN}).utils({table: 'table_name'}).kv; await kv.set({ key: 'key', value: 'value' }); ``` If you do not specify a table, you will use the default one tied to your account.
Deletes the key-value pair specifed at [key].
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
table
string
(no description)
optional, default value is
null
optional, current value set to
enter a test value
key
required
string
(no description)
current value set to
enter a test value
Returns all key-value pairs in [table].
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
table
string
(no description)
optional, default value is
null
optional, current value set to
enter a test value
Gets the value specified by [key].
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
table
string
(no description)
optional, default value is
null
optional, current value set to
enter a test value
key
required
string
(no description)
current value set to
enter a test value
defaultValue
any
(no description)
optional, default value is
null
optional, current value set to
enter a test value
Sets a key-value pair in the specifed [table]. The max key size is 1kb and the max value size is 9kb.
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
table
string
(no description)
optional, default value is
null
optional, current value set to
enter a test value
key
required
string
(no description)
current value set to
enter a test value
value
required
any
(no description)
current value set to
enter a test value
ttl
integer
Automatically expires the key-value pair at now + ttl (in seconds)
optional, default value is
null
optional, current value set to
enter a test value
Clears all keys-value pairs in [table]. A table name must be provided. If you want to truncate your default table, pass in your username as the table name.
Authenticated   |   Pricing  ·  Free   |   Limit  ·  no rate limit
Unauthenticated   |   Limit  ·  no rate limit
Parameters
table
required
string
(no description)
current value set to
enter a test value
Made with by the utils team with the help of Standard Library.