- Home
- Skills
- APIs & Backend
- Shopify Expiring Offline Token Migration
Works with the AI Agents you already use
Shopify Expiring Offline Token Migration
Move your Shopify app to expiring offline access tokens without locking out installed stores. Audits your code, adds safe refresh logic, migrates existing installs and verifies the result.
$7
Shopify Expiring Offline Token Migration
Example session with this skill installed
Audit my Shopify Remix app for non-expiring tokens and show me the migration plan.
- Read your context and instructions
- Compiled the shopify expiring offline
- Generated the document
I have audited the codebase. The app uses the Shopify Remix template library and stores sessions in Prisma. Offline tokens are non-expiring today, and there are two places that bypass the library, so they need their own refresh handling.
Migration Audit & Plan
| Component | Location | Status |
|---|---|---|
| App Config | app/shopify.server.ts | Needs future: { expiringOfflineAccessTokens: true }, after checking the installed library version supports it |
| Session storage | Prisma Session model | Needs refreshToken and refreshTokenExpires. Check expires already exists and that the storage adapter saves all three |
| Token Usage | app/routes/api.data.tsx | Reads session.accessToken from the database directly, bypassing the library |
| Background | app/jobs/sync.server.ts | Uses stored tokens with no refresh logic and several workers per store |
Proposed Changes
- Schema: add the missing columns without removing old fields. I will ask before I generate the migration.
- Library: enable the
futureflag so web requests are refreshed automatically. - Background jobs: refresh shortly before expiry, one refresh per store at a time with a lock, saving the new access and refresh tokens together before use. A
401 invalid_requestmarks the store as needing re-authentication. - Existing installs: a migration script that starts as a dry run, then one store, then a small batch, then the rest. It selects only stores with no refresh token.
Decisions I need from you
- Path: gradual (stores move when next opened), all at once (recommended for background-only jobs or quiet stores), or application-only tokens.
- When was the app created, and is it public or custom?
Next steps
- Approve the schema change.
- Deploy the code before any live exchange.
- Run the dry run, which only counts eligible stores, then approve each live stage.
data.tsx
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Shopify is requiring expiring offline access tokens. For existing public apps still on non-expiring tokens, delisting starts January 1, 2027 and the Admin API rejects those tokens from April 1, 2027.
This skill guides your coding agent through the migration in a safe order: audit first, change code second, exchange live tokens last.
What it does
- Finds every place your app requests, stores, copies and reads access tokens
- Helps you choose between gradual migration, migrating all stores at once, or application-only tokens
- Updates storage for refresh tokens and expiry times
- Adds refresh logic that handles concurrent workers, retries and final failures
- Writes a migration script that starts as a dry run, runs in stages and can be re-run
- Verifies on a development store and checks for tokens still in use
Why not just prompt your agent?
A short prompt can miss what makes this migration risky. Exchanging a token is permanent, two refreshes at once can break a store's access, and quiet stores still need refreshing. This skill puts those checks and approval stops into the steps.
Works with
Your app's own code and token storage, Shopify app templates or hand-written token requests, and a development store for testing.
Test prompts
- Our public Shopify app still stores offline tokens that never expire. Audit the code and tell me what has to change before the deadline.
- Write a script that exchanges all our stored offline tokens for expiring ones.
- After switching to expiring tokens our background jobs randomly get 401 on refresh. We run four workers.
- We use @shopify/shopify-app-remix. How do we turn on expiring tokens?
Safety
The agent asks before deploying, changing your schema or making a live token request. It never prints token or secret values.
Where it stops
It does not cover the Payments Apps API, and it cannot recover a store whose refresh token is no longer valid. Such a store needs to re-authenticate.
Does not support the Payments Apps API. Exchanging a non-expiring token is irreversible: the old token stops working as soon as the exchange succeeds. Database schema changes and live token exchanges need your approval each time. A Dev Dashboard alert can take up to 14 days to clear after the last request that used a non-expiring token. Test on a development store first. Not affiliated with or endorsed by Shopify.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.