New Shopify Certification now available: Liquid Storefronts for Theme Developers

Shopify API

codercrux
Shopify Partner
1 0 0

When we creating a API, I figured that I need to configure new Shopify like this

 

const shopify = new Shopify({
  shopName: 'your-shop-name',
  apiKey: 'your-api-key',
  password: 'your-app-password'
});

 

Is there any way to get the Shopify "your-shop-name" programmatically? So If I installed the app on another one it won't need to change. Or is there any other way to configure the API on Shopify?

I primarily need to update the product description using Admin REST API.

Reply 1 (1)
Eric-HAN
Shopify Partner
8 1 1

hi, 

you could create .env file to set env variant values. 

and use  process.env.variant_name to access it.

If this is helpful, please thumbs up
--Feel free to contact me on (iyouandhim@gmail.com)