Getting isssues on adding data to KV store

Logs [wrangler:inf] POST /api/v1/renewal-reminders 200 OK (33ms) Code: const app = new Hono(); const openapi = fromHono(app, { docs_url: "/swagger.html", }); openapi.post('/api/v1/renewal-reminders', CreateRenewalReminder); export class CreateRenewalReminder extends OpenAPIRoute { async handle(ctx) { const key = uniqueGenrationLoginc; const data = await this.getValidatedData<typeof this.schema>(); const taskToCreate = data.body; await ctx.env.RENEWAL_REMINDER_INFO_BRAND.put( key, JSON.stringify(taskToCreate)
) return { success: true, }; } } export default app https://github.com/orgs/honojs/discussions/3978
GitHub
Unable to put key value in KV store using ctx and also not getting ...
Not getting any error when i call the API it gives me 200 but key value is not preset in Store if i check from dashboard logs [wrangler:inf] POST /api/v1/renewal-reminders 200 OK (33ms) const app =...
4 Replies
react_webapps🚀
react_webapps🚀OP•2mo ago
Also tried Bindings as per documentation but didn't worked type Bindings = { RENEWAL_REMINDER_INFO_BRAND: KVNamespace }
const app = new Hono<{ Bindings: Bindings }>();
ambergristle
ambergristle•2mo ago
hey! can you share a little more about your setup? it sounds like you're trying to update a remote KV store. are you running your app locally or deployed? also, have you tried to access the value within the same request? what does the put return?
react_webapps🚀
react_webapps🚀OP•2mo ago
Locally Yes within same spi call Let me console that It gives me undefined
ambergristle
ambergristle•2mo ago
does this mean you can access the data from within the app? at least during the request? are you sure you're writing to the remote KV instead of a local one?

Did you find this page helpful?