@venkat have you looked at the session sharing plugin?
Allows login sessions from your app to persist in NodeBB - GitHub - julianlam/nodebb-plugin-session-sharing: Allows login sessions from your app to persist in NodeBB
faviconGitHub (github.com)
It provide functions for retrieving the NodeBB id from your id.
Using that plugin is the recommended way of sharing sessions between applications.
Changing the NodeBB id format is a futile effort. You can't just change it to a string. The closest you can do is map your id to the NodeBB id.