Shopify is preparing public apps for a major security change: Admin API tokens will start expiring on April 1, 2027. To give developers a safe runway, the Dev Dashboard now lets you opt‑in to token expiry today. This post walks you through what changed, who needs to care, and exactly how to enable the setting and verify your app’s behavior before the enforcement deadline.
What Changed
When you toggle the *Admin API token expiry* switch on an app’s Settings page, the following rules are applied to every store where that app is installed:
Who’s Affected
How to Opt‑In and Validate Your Migration
Code Example: Updating Your OAuth Flow
Below is a minimal Node.js/Express snippet that requests an online token (which expires automatically) and stores the refresh token for later use. Notice the grant_options[]=per-user flag, which is required for expiring tokens.
javascript
app.get('/auth', (req, res) => {
const shop = req.query.shop;
const redirectUri = ${process.env.HOST}/auth/callback;
const authUrl = https://${shop}/admin/oauth/authorize? +
client_id=${process.env.API_KEY} +
&scope=${process.env.SCOPES} +
&redirect_uri=${encodeURIComponent(redirectUri)} +
&state=${nonce()} +
&grant_options[]=per-user;
res.redirect(authUrl);
});
app.get('/auth/callback', async (req, res) => {
const { shop, code, state } = req.query;
// Verify state, exchange code for token
const tokenResponse = await fetch(https://${shop}/admin/oauth/access_token, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
client_id: process.env.API_KEY,
client_secret: process.env.API_SECRET,
code,
grant_options: ['per-user']
})
});
const data = await tokenResponse.json();
// data.access_token is now an expiring token (max 24h)
// data.refresh_token can be used to obtain a new access token
// Store both securely for the shop
await storeTokens(shop, data);
res.redirect('/');
});
Best Practices Before the 2027 Deadline
Conclusion & Next Steps
Enabling Admin API token expiry in the Dev Dashboard is a low‑risk way to future‑proof your Shopify app. By opting in now, you can catch token‑related errors early, update your authentication flows, and ensure a smooth experience for merchants when the April 1, 2027 enforcement kicks in.
Ready to test? Open your app’s Settings in the Dev Dashboard, turn on the token‑expiry toggle, and start monitoring. If you hit any snags, revisit the migration guide or drop a comment below – we’re here to help you stay compliant and secure.
