SET Profile Data

Stateful

Stateful

box.public.set(key, value)

Set a value for the given key, in the public profile.

Kind: instance method of KeyValueStore Returns: Boolean - true if successful

Param

Type

Description

key

String

the key

value

String

the value

box.private.set(key, value)

Set a value for the given key, in the private profile.

Kind: instance method of KeyValueStore Returns: Boolean - true if successful

Param

Type

Description

key

String

the key

value

String

the value

box.public.setMultiple(keys, values)

Set multiple values for multiple keys, in the public profile.

Kind: instance method of KeyValueStore Returns: Boolean - true if successful, throw error if not

Param

Type

Description

keys

Array.<String>

the keys

values

Array.<String>

the values

Example:

const fields = ['name', 'website', 'employer']
const values = ['Jon Schwartz', 'openworklabs.com', 'Open Work Labs']
await box.public.setMultiple(fields, values)

box.private.setMultiple(keys, values)

Set multiple values for multiple keys, in the private profile.

Kind: instance method of KeyValueStore Returns: Boolean - true if successful, throw error if not

Param

Type

Description

keys

Array.<String>

the keys

values

Array.<String>

the values

Example:

const privateFields = ['age', 'coinBalance']
const privateValues = ['xxx', 'yyy']
await box.private.setMultiple(privateFields, privateValues)