You should never use composables meant for Vue or Nuxt in API routes. You are going to be able to get a NuxtApp instance in server routes...
so useRollbar(); or useNuxtApp().$rollbar; won't work.
I'm confused as to what the serverAccessToken is used for?
I see in this implementation for the server-side they initialise Rollbar as an errorMiddleware
https://github.com/gaelreyrol/nuxt-rollbar-module/blob/develop/lib/rollbar.js
You should never use composables meant for Vue or Nuxt in API routes. You are going to be able to get a NuxtApp instance in server routes...
so useRollbar(); or useNuxtApp().$rollbar; won't work.
I'm confused as to what the serverAccessToken is used for?
I see in this implementation for the server-side they initialise Rollbar as an errorMiddleware
https://github.com/gaelreyrol/nuxt-rollbar-module/blob/develop/lib/rollbar.js