Products · Dash API

Secrets

Keep small private values, such as a session token, encrypted on the phone.

A dot's secrets, such as tokens its own API gives the person. Holds up to 32 strings of up to 4 KB each, encrypted with a key that never leaves the device. Don't keep the dot's own API keys here: they would ship in its bundle, which anyone can read.

dash.storage.secret.get

TypeScript
dash.storage.secret.get(key: string, callOptions?: CallOptions): DashRequest<string | null>

The secret saved under key, or null if there isn't one.

dash.storage.secret.set

TypeScript
dash.storage.secret.set(key: string, value: string, callOptions?: CallOptions): DashRequest<void>

Saves value under key, encrypted on the phone.

dash.storage.secret.remove

TypeScript
dash.storage.secret.remove(key: string, callOptions?: CallOptions): DashRequest<void>

Deletes the secret saved under key. Deleting one that isn't there is fine.

dash.storage.secret.clear

TypeScript
dash.storage.secret.clear(callOptions?: CallOptions): DashRequest<void>

Deletes all of the dot's secrets.

Keep reading