Migrating from Shopify Scripts to Shopify Functions
Shopify Functions are similar to Shopify Scripts, which let developers create custom commerce experiences.
On this page
Shopify Functions
Shopify Functions are installed as part of an app. They're configured alongside other features directly in your Shopify admin, which means that merchants don't need to use code when they're creating or modifying customizations. The WebAssembly platform that runs Shopify Functions offers better performance than Shopify Scripts, executing code in under 5 milliseconds. Because of this, Shopify Functions can support large sales events such as flash sales with no decrease in performance.
By using Shopify Functions, developers can code and unit test in their own local environment. Developers distribute their Shopify Functions customizations as part of an app, rather than copying and pasting Ruby code into each store. Finally, timeout and CPU memory limit issues are reduced by using Shopify Functions.
Migrating to Shopify Functions with the Shopify Scripts customizations report
The Shopify Scripts customizations report is a personalized page in your Shopify admin that displays the existing Scripts customizations that are active in your store, and provides Shopify Functions documentation or relevant app links that can help you recreate the customizations.
Shopify Scripts customizations reports are generated automatically. You can also export your report and view it as a CSV file. You need to recreate your customizations using Shopify Functions before August 28, 2025.
Reviewing your customizations
Depending on the scripts that you have, your report page might contain sections for Payment gateways, Shipping, and Product discounts customizations.
Each section can include the name, description, and source file links of your Shopify Scripts customizations, links to recommended apps that are built with Shopify Functions and that are specific to your customizations, and links to Shopify Functions tutorials.
Review the report's information to decide whether you want to recreate your customizations with the following options:
- Build your own solution using Shopify Functions
- Install apps that are built on Shopify Functions
Recreate your customizations
From your Shopify admin, go to Settings > Apps and sales channels.
Click Script Editor.
In the Replace your Shopify Scripts banner, click Replace Shopify Scripts.
-
In each section that you have in your Customizations report, do any of the following:
- To view your existing Shopify Scripts customizations, click the name of the script under the number of Auto detected customizations.
- To view or install compatible apps that match your scripts, in the Recommended apps section, click Install for an app that you want to use, or click More apps like this to find other compatible apps.
- To view Shopify Functions tutorials, in the How to recreate using Shopify Functions section, click the relevant function API link.
When you've successfully tested with an app or a Shopify Functions customization, you can deactivate the script that you're replacing.
Using Shopify Scripts with Shopify Functions
Shopify Scripts will continue to work on checkouts that are customized with checkout.liquid
and on checkouts that have been upgraded until August 28, 2025.
Shopify Scripts and Shopify Functions can be used at the same time in a single store. If your scripts can't currently be replaced by using Shopify Functions, then continue to use Shopify Scripts until the Shopify Functions APIs meet your needs. Refer to the following to determine how Shopify Scripts and Shopify Functions interact.
Line item scripts
Line item scripts execute before Shopify Functions, which includes discounts that are created by apps. Line item scripts cannot access the amounts that have been discounted by functions & apps.
Scripts can access only the first discount code applied to the checkout, and can't access into other discount codes that might have been used. For example, using reject
operates on the first discount applied to the checkout, and does not affect other discounts.
Shipping scripts
Shipping scripts execute after delivery customizations that are created by Shopify Functions. Scripts can't operate on modified delivery customization rename results, but can operate on customizations that move or hide.
Payment scripts
Payment scripts execute after payment customizations that are created by Shopify Functions. Scripts can't operate on modified payment customization rename results, but can operate on customizations that move or hide.