getSessionToken() returns null in New POS UI Extensions.

LakshayLakshay
Shopify Partner
11 0 0

Hi,

I am creating an app using the new POS UI Extensions and i want to hit a 3rd party api, after doing some research i got to know i have to create a route in the app backend and then hit that route from UI File ( POS Extension file ) and handle data in req,res manner.

I have create a route in the app backend file ( get - /testpos )

Now for the execution of route from UI File, i need to have a sessionToken with me that i have to send in the header.

For the session token a api is there in the POS UI documentations - https://shopify.dev/docs/api/pos-extensions/ui-extensions-reference/api/session,
upon following every instruction and replacing the entire code with the sample code in the doc, i receive the session Token as Null

IMG_3821.jpg

 

 

L Kalra
Replies 3 (3)
raj02
Shopify Partner
3 0 1

Hey @LakshayLakshay . Any updates on this? I'm facing the same issue of receiving session token as null

LakshayLakshay
Shopify Partner
11 0 0

Hi @raj02 , I reached out to shopify regarding this and the issue was i didnt install the app on the dev store.
Then they added a note to the documentation.

Screenshot 2023-11-09 at 12.58.50.png

Hope this helps.

L Kalra
raj02
Shopify Partner
3 0 1

Thanks for the info @LakshayLakshay but doesn’t solve my issue. I have the app installed. It was working fine until few days back but suddenly faced this issue.