This repository addresses a common Shopify issue: the inability to bulk update customers' default languages. By default, Shopify sets all imported customers to the store's default language, ignoring their original language settings from another store. Although there's no locale
property directly available, this tool uses the Admin API to send the necessary updates. It automates the process of updating customer languages, making it useful for post-migration adjustments or correcting default language settings for existing customers.
- Node Version Manager (nvm): Ensure you have nvm installed to manage Node.js versions.
- Ngrok Account: Create an account on ngrok to obtain the right API keys for creating secure tunnels.
- Shopify API Credentials: Create a private app in your Shopify store to obtain the necessary Admin API credentials (API key and Admin API access token) to read and write customers. See tutorial here.
Use the specified Node.js version required for the project.
nvm use
Install all necessary npm packages.
npm i
Create an ngrok tunnel for local development. This will generate a unique URL.
ngrok http 3000
In the root directory, create a .env
file and update with the right details:
SHOPIFY_SHOP_NAME=<add shop name here>
SHOPIFY_APP_VERSION=<add app version here>
SHOPIFY_APP_ACCESS_TOKEN=<add app access token here>
NGROK_URL=<add ngrok url here>
In the root directory, go to the data.jsonl
and populate it with the customer data in the CustomerInput type format, ensuring it's in JSONL format. To export all customers and create the correct format, you can use Matrixify and a tool like ChatGPT to help format the data. You should use a country code to for the locale field, this can either be set manually because you are migrating customers from a specific store, or use the customer's Address Country Code. See example below:
{ "input": { "id": "gid://shopify/Customer/2024050001", "locale": "EN" }}
{ "input": { "id": "gid://shopify/Customer/2024050002", "locale": "NL" }}
⚠️ Only do this in production after you've tested it on a development store
Run the application to begin processing and updating customer languages.
npm run start
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.