stringToPayload
stringToPayload(
data):Uint8Array
Defined in: src/utils/payload.ts:32
A string as an entity payload, encoded as UTF-8.
Hex-looking text is encoded as text: stringToPayload("0xab") gives the four bytes of that
string, not the single byte 0xab. Read it back with entity.toText().
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Uint8Array
Example
Section titled “Example”await client.createEntity({ payload: stringToPayload("hello"), contentType: "text/plain", expires: ExpirationTime.fromDays(30),})