Documentation
Everything you need to migrate from Shopify Scripts to Shopify Functions.
What is ScriptShift?
ScriptShift is a migration tool that converts Shopify Scripts (Ruby) into Shopify Functions (JavaScript). Shopify is deprecating Script Editor on June 30, 2026 — after that date, all Ruby scripts will stop running in checkout.
ScriptShift analyzes your existing Ruby scripts, detects the patterns used (discounts, shipping rules, payment conditions), and generates ready-to-deploy Shopify Function code with the correct API targets, input queries, and configuration.
Free tier: 5 analyses per day with full code generation. No account required.
Quick Start (Free Analysis)
- Go to scriptshift.projectgreenbelt.com
- Paste your Ruby script into the editor (or choose a sample template)
- Click "Analyze + Generate Code"
- Review the analysis: detected patterns, complexity score, migration effort
- Switch to the "Generated Code" tab to see your Shopify Function files
- Copy each file (
src/run.js,input.graphql,shopify.extension.toml) - Follow the install instructions to deploy to your store
Installing on Your Store
For automatic script detection and unlimited analyses, install ScriptShift on your Shopify store:
- Enter your
*.myshopify.comURL in the install box on the homepage - Authorize the app (read-only access to your Script Editor scripts)
- ScriptShift auto-detects all active scripts and analyzes them
- View migration status, generated code, and testing instructions in the dashboard
Supported Script Types
| Script Type | Ruby Context | Shopify Function API |
|---|---|---|
| Line Item Scripts | Input.cart.line_items | Product Discounts, Order Discounts, Cart Transform, Cart Validation |
| Shipping Scripts | Input.shipping_rates | Delivery Customization |
| Payment Scripts | Input.payment_gateways | Payment Customization |
Pattern Detection
ScriptShift detects 22+ Ruby patterns across all three script types:
Complexity Scoring
1 pattern detected. Estimated < 1 hour. Auto-migration available.
2-3 patterns detected. Estimated 1-4 hours. Review generated code.
4+ patterns or warnings. Estimated 4-8 hours. Manual review recommended.
Generated File Structure
Each generated Shopify Function includes three files:
my-script-discount/ ├── src/run.js # Function logic (JavaScript) ├── input.graphql # Data query (what the function receives) └── shopify.extension.toml # Extension configuration
- src/run.js — The main function. Receives cart/checkout data and returns discounts, delivery operations, or payment operations.
- input.graphql — Defines what data the function requests from Shopify (cart lines, customer tags, metafields, etc.).
- shopify.extension.toml — Configuration file specifying the API target, build settings, and UI paths.
Deploying Generated Code
- Create a Shopify app (if you don't have one):
shopify app init - Generate a Function extension:
shopify app generate extension --type product_discounts --name my-discount - Replace the generated files with ScriptShift's output
- Test locally:
shopify app function run - Deploy:
shopify app deploy - In Shopify admin, create a discount that uses your new Function
Testing Your Functions
Always test on a development store before going live:
- Install the app on your development store (not production)
- Create test discounts/customizations using the new Functions
- Run through checkout with various cart configurations
- Compare results with your existing Script behavior
- Use the Migration Risk Simulator to test logic against historical data
- Once verified, deploy to production and disable the old Script
POST /api/scripts/analyze
Analyze a Ruby script and detect patterns.
curl -X POST https://scriptshift.projectgreenbelt.com/api/scripts/analyze \
-H "Content-Type: application/json" \
-d '{"source": "Input.cart.line_items.each do |item|\n item.change_line_price(item.line_price * 0.9, message: \"10% off\")\nend\nOutput.cart = Input.cart", "title": "My Script"}'Returns: script type, detected patterns, complexity score, estimated effort, auto-migration eligibility.
POST /api/scripts/migrate
Analyze AND generate migration code in one call.
curl -X POST https://scriptshift.projectgreenbelt.com/api/scripts/migrate \
-H "Content-Type: application/json" \
-d '{"source": "...", "title": "My Script"}'Returns: analysis results + generated Function files (run.js, input.graphql, extension.toml).
Rate Limits
| Tier | Limit | Code Gen |
|---|---|---|
| Free (anonymous) | 5 analyses / day | ✅ Included |
| Installed (authenticated) | Unlimited | ✅ Included |
| Pro ($49/mo) | Unlimited | ✅ + Auto-detect + Testing |