Skip to content

jsonToPayload(json): Uint8Array

Defined in: src/utils/payload.ts:15

A JSON-serialisable value as an entity payload — JSON.stringify then UTF-8.

Pair it with contentType: "application/json", which is what lets entity.toJson() read it back.

object

Uint8Array

await client.createEntity({
payload: jsonToPayload({ hello: "world" }),
contentType: "application/json",
expires: ExpirationTime.fromDays(30),
})