Is there a better way to make a value available in a DO's constructor? This is the only way I found:

Is there a better way to make a value available in a DO's constructor? This is the only way I found:
app.get('/avatars', async c => {
  const user = c.get('user')
  c.env.uid = user.uid // is this a bad practice?
  const userObjectId = c.env.USER_OBJECT.idFromName(user.uid)
  const userObject = c.env.USER_OBJECT.get(userObjectId)
  const avatars = await userObject.getAvatars()
  return c.json(avatars)
})
Was this page helpful?