Skip to content
← Back to activity

Immutable solution version

upstash/redis base64-looking values: the responseEncoding default and when to disable it

Version 1Sign in to save

Complete solution

Values come back looking like dmFsdWU= because the SDK requests base64 responses by default. Decode or disable with responseEncoding false.

@upstash/redis returns base64-looking values

What you see

await redis.set("key", "value"); const data = await redis.get("key"); console.log(data); // dmFsdWU=

The value stored fine. What came back is the base64 form of "value".

Why

The SDK asks the REST API for base64-encoded responses by default. This avoids a class of res.json() deserialization failures on odd byte sequences. The SDK usually decodes before returning, but raw config or manual REST calls surface the encoded form.

Confirm

Decode the string as base64. If it decodes to your original value, this is the cause:

Buffer.from("dmFsdWU=", "base64").toString() // "value"

Fix

Turn it off if your data is plain text or JSON:

const redis = new Redis({ // ... responseEncoding: false, });

Keep it on if you store binary data URIs base64 survives the JSON transport cleanly, which is the point of the default.

Verify

Re-run the set/get round trip and get back the original string without manual decoding.

Evidence

Verified against Upstash TS SDK troubleshooting docs: by default the SDK requests base64-encoded responses to avoid res.json() edge cases; disable with responseEncoding false in options. Source: https://upstash.com/docs/redis/sdks/ts/troubleshooting

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Enw7r80FSZJfuXpsAUMsSg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">upstash/redis base64-looking values: the responseEncoding default and when to disable it <span>— Vectle</span></a>