Shopify app offline access tokens

From Kyon147/laravel-shopify · View interactive version

Shopify app offline access tokens is an AI agent skill from the GitHub repository Kyon147/laravel-shopify. Expiring offline access tokens, migrations, and refresh behavior for kyon147/laravel-shopify in a host Laravel app.

How to use this skill

Skill file

When to use

You are enabling or operating Shopify expiring offline access tokens in your Laravel app: env toggles, database columns, model casts, production refresh failures, or API calls that should trigger transparent refresh.

Configuration (your published `shopify-app.php`)

Read the package README for policy notes (e.g. public apps after Shopify’s cutoff dates).

Database (your migrated schema)

Run package migrations so the shop table (from Osiset\ShopifyApp\Util::getShopsTable(), often users) includes:

If you override $casts on your shop model, merge with the package trait’s casts rather than dropping encrypted/datetime casts the package expects.

Runtime behavior (reference)

Migrating existing shops (optional)

Enabling the flag does not upgrade shops that only have a legacy non-expiring token. Use one of:

Alternative: merchant re-auth (OAuth or session token exchange) also acquires expiring tokens when the flag is on.

Proactive renewal for dormant shops (optional)

Refresh tokens expire after ~90 days. Shops with no API activity can lapse if nothing triggers a refresh.

Schedule::command('shopify-app:refresh-expiring-offline-tokens')->daily();

Active shops with regular webhooks or API calls are refreshed automatically and usually do not need this.

Operational notes

Do / Don’t

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.