Shopify shop tokens now expiring after 24 hours?

Solved
Chad_Johnson
Shopify Partner
18 1 7

I developed an app in the past. When the app is installed, Shopify delivers a token to our app which can be used to make calls to Shopify's API on behalf of the store. This token never expired (or the expiration was relatively far in the future).

I'm developing a new app now, and I'm noticing that access tokens are expiring in 24 hours. These tokens begin with 'shpat_'.

My app will need to make requests on behalf of the shop to Shopify's API daily. It's no good if access tokens expire for shops after 24 hours.

So what gives? Did Shopify make some change? Or is this happening because my app is in development mode? What's going on?

0 Likes
Chad_Johnson
Shopify Partner
18 1 7

This is an accepted solution.

Solved.

I am using the @shopify/koa-shopify-auth package, and turns out accessMode is by default set to "online", and per the docs, online access token lifetimes match the lifetimes of the user's web session.

The solution was to set accessMode to "offline" via the shopifyAuth middleware function.

0 Likes