rollbar/pyrollbar

Unable to set platform to client to enable "post_client_item" access token

jamwil opened this issue · 2 comments

It appears there is no way to set the platform using the pyrollbar SDK. I receive the following response when attempting to use a client access token. I have tried initializing rollbar with rollbar.init() including a platform="client" keyword argument, but this appears to be dropped in the submitted requests.

Response:
{
  "err": 1,
  "message": "insufficient privileges: post_server_item scope is required but the access token only has post_client_item."
}

I use rollbar to track exceptions in a client-side desktop application, however I know the most common use case is server-side implementations so I can understand how this may have never been implemented. If I am missing something, please point me in the right direction.

Thanks!

@jamwil This should be possible by setting BASE_DATA_HOOK, like this:

def my_base_data_hook(request, data):
    data['platform'] = 'client'

import rollbar
rollbar.BASE_DATA_HOOK = my_base_data_hook

@brianr Thanks Brian! I'll implement and re-open if this doesn't do the trick.