Session Token Authentication Issue – onTCPL window not defined Error in Public App

Hi everyone,

I’m building a “public app for Shopify” and have followed all the necessary steps to enable session token authentication using App Bridge. Everything is configured

However, I’m running into an issue when implementing session token authentication.

  1. The session token is not being generated, and my authenticated route is never hit.
  2. I’m getting the following error in the console:
    onTCPL window not defined

I’d really appreciate some help in understanding below:

  1. What does onTCPL window not defined mean in this context?
  2. Could this be something related to App Bridge itself or something else?
  3. Is there a recommended way to debug why session tokens aren’t being returned?
1 Like

Hey @Niraj_Thaper

Thanks for your question. I’m going to look in to this error and see if I can get more context for you. I’ll follow up again once I have more to share.

Thanks! I look forward to your response.

1 Like

Hey @Niraj_Thaper , sorry for the delay here. I’ve checked here and the onTCPL doesn’t seem to be something specific to app bridge and looks to be specific to your code.

Are you using our remix template for your app? If not, I would recommend using that if possible, as the starter app does have the code for managing session tokens and token exchange.

Hey @Niraj_Thaper , just checking in to see if you’ve been able to resolve the issue and if the above documentation on session tokens helped?