Works with the AI Agents you already use

    Shopify Expiring Offline Token Migration

    by Nahid hossain

    1

    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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Shopify Expiring Offline Token Migration

    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

    ComponentLocationStatus
    App Configapp/shopify.server.tsNeeds future: { expiringOfflineAccessTokens: true }, after checking the installed library version supports it
    Session storagePrisma Session modelNeeds refreshToken and refreshTokenExpires. Check expires already exists and that the storage adapter saves all three
    Token Usageapp/routes/api.data.tsxReads session.accessToken from the database directly, bypassing the library
    Backgroundapp/jobs/sync.server.tsUses 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 future flag 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_request marks 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

    1. Path: gradual (stores move when next opened), all at once (recommended for background-only jobs or quiet stores), or application-only tokens.
    2. When was the app created, and is it public or custom?

    Next steps

    1. Approve the schema change.
    2. Deploy the code before any live exchange.
    3. Run the dry run, which only counts eligible stores, then approve each live stage.

    data.tsx

    PDF · document

    Generated

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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.

    Frequently Asked Questions

    This skill identifies non-expiring offline access tokens in your code and migrates them to expiring pairs. It prevents 403 errors and app delisting by adding safe refresh logic and batch-exchanging existing merchant tokens before the 2027 Shopify deadline.

    You need to provide the app codebase for auditing and your Shopify client credentials. For the migration phase, the skill requires access to your token storage, such as database tables or secret stores, and a development store for safe testing.

    The skill produces a full codebase audit, updated authentication and storage logic, a resumable migration script for existing installs, and a verification suite of tests. It provides reports on migrated stores, failed exchanges, and remaining legacy tokens.

    This skill does not support the Shopify Payments Apps API. It also requires manual approval for all database schema changes and live production token exchanges to ensure no merchants are accidentally locked out.

    The skill includes a batch migration script that uses dry-run protection to count eligible stores first. It exchanges tokens one by one, verifying each save before moving to the next, and uses shared locking to prevent race conditions during concurrent refreshes.

    You can ask your agent to audit your Shopify app for non-expiring tokens or help you migrate to expiring offline access tokens to meet the 2027 deadline. It is also helpful to mention if you are seeing 403 errors regarding non-expiring tokens.

    The template change is usually a single setting. The skill still helps you check your session storage and find code that reads tokens directly.

    Custom apps created on or after December 1, 2026, must use expiring tokens. Older ones may keep their existing tokens.

    Your app may keep its client ID and secret there. The skill does not collect, print or store them. They are used only by your app's own code and by the token requests you approve.

    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.