Get rendering id of current env

Feature(s) impacted

Hi, I need somehow to obtain the rendering id of current env (set by FOREST_ENV_SECRET), which I believe can be call by some rest API.

As I can see in the client library, we can have get request to https://api.forestadmin.com/liana/{some-path} with forest-secret-key as header.

The problem is these API endpoint is not documented anywhere.

Could you guys please help?.

This rendering id is very important because I want to use this feature:

const recordGetter = new RecordsGetter(NewPaymentModel, { renderingId: forestEnvId } as User, ctx.query);

Observed behavior

Expected behavior

Failure Logs

Context

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent (forest package) name & version: “forest-express-mongoose”: “^9.3.2”
  • Database type: …
  • Recent changes made on your end if any: …

Hello @Thong_Dang,

Indeed, this is intentional. The logic is hidden within your forest-express-mongoose agent.

As I answered in the last topic you should have the request.user automatically setted by the authentication middleware (which avoid doing some fancy stuff).

  • The question is Do you have the ensureAuthenticated middleware mounted on your project?

  • Could you share your project name ?

  • How did you integrate forest-express-mongoose within your app?

Thanks for your anwsers.

Kind regards,
Morgan

Hi, thanks for your response, really appreciated.

We don’t use express as server library but we are using koa, and their middleware are not compatible, hence the issue with authorization header parsing.

I managed to fix this by an simple ctx.req.headers assignment.

Thanks again!

1 Like

Hey @Thong_Dang,

Nice that you found out. :pray:

Our new agent Node.js is natively compatible with Koa. :muscle:
It might be the right path for you in the future as the developer experience is highly improved and it comes with new features.

Kind regards,
Morgan