What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (2024)

collections

Newsletter

Sign up to get the latest on sales, new releases and more …

recent posts

Why People Prefer Supplements Over Anti-Aging Drugs Like Metformin

How Caloric Restriction Enhances Longevity and Brain Function

Could Stem Cells Restore Vision to the Sight-Impaired?

How Ashwagandha Boosts Brain and Body Health in Older Adults

What are the Supergreens Ingredients? A Complete Guide to Super Green Powders

Ultimate Guide to NMN-H: Best NMN Supplement for Longevity

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects

What is Nicotinamide Riboside (NR)? Role of Nicotinamide in Health

What is Chromium Supplement? Benefits, Dosage, and Side Effects

What is Myo-Inositol? Inositol Benefits for Insulin Sensitivity and Metabolic Syndrome

What is Berberine? Berberine Benefits, Dosage, and Key Side Effects

Benefits of Vitamin E, Dosage, and Key Side Effects

What is Myricetin? Benefits, Dosage, and Side Effects?

What is a Super Greens Powder Supplement?

What is Fisetin? Benefits, Dosage, and Side Effects

What is Magnesium Glycinate: Benefits, Dosage, and Side Effects

What is Ashwagandha? Benefits of Ashwagandha, Dosage, and Side Effects

What is Apigenin? Therapeutic Potential of Apigenin, Dosage, and Side Effects

What is Calcium Alpha-ketoglutarate (Ca-AKG)? Benefits and Longevity

What is Met4min? A Natural Metformin Alternative | Longevity Box

What is Magnesium Complex Supplement in Capsules?

What is Trans-Resveratrol? Health Benefits of Resveratrol Supplements

What is Senolytics? Benefits, Dosage, and Senescence Support

What is Sulforaphane? Benefits, Dosage, and Health Insights

What Is Spermidine? Anti-Ageing Effects on Human Health

What Is TMG Supplement (Trimethylglycine)?Dosage and Benefits

Understanding How Certain Foods Can Help Us Live Longer and Healthier

Boosting NAD+ with NMN Improves Metabolism

New Study Tests if Rapamycin Can Help Older Adults Stay Strong and Active

Scientists Use Cell Rejuvenation Technology to Reverse Brain Aging in Mice with Alzheimer's

A Simple Way to Boost Your Brain and Live Longer: Study Insights

The Power of Plasma Exchange: Can It Make Us Younger?

How One Woman’s Daily Routine Could Help You Live Longer

How Space Could Unlock Unlimited Stem Cells for Health Research

How Stress Affects Our Brains and Speeds Up Aging

Could Semaglutide Extend Lifespan by Reducing Inflammation?

Understanding Microplastics: Are They the Invisible Threat to Health?

Understanding the Connection Between Olfactory Health and Longevity

Can Gene Therapy Extend Human Lifespan? Exploring Follistatin's Role

How NR and CoQ10 Supplements Could Benefit People with Kidney Disease

How Robert Downey Jr. Stays Youthful: Diet, Supplements, and Exercise

How Purposeful Living Impacts Human Longevity: Insights from a Study

tag cloud

  • NAD
  • NMN
  • TMG

Pure NMN Supplement

NAD+ Boosters

Ultra Pure NMN Powder Our ultra-pure NMN powder is third-party tested, offering super-high potency and 99% purity. It is manufactured...

£54.99

Sold Out

Pure NMN Supplement

Ultra Pure NMN Powder Our ultra-pure NMN powder is third-party tested, offering super-high potency and 99% purity. It is manufactured...

Pure NMNH Supplement

NAD+ Boosters

Ultra Pure NMNH Our ultra-pure NMNH is third-party tested, offering super-high potency and 99% purity. It is manufactured in a...

£59.99

Sold Out

Pure NMNH Supplement

Ultra Pure NMNH Our ultra-pure NMNH is third-party tested, offering super-high potency and 99% purity. It is manufactured in a...

TMG Supplement

NAD+ Boosters

Potent methyl donor support for NMN Over 99% PureTMG Independently lab tested Gluten-free, vegan and allergy friendly 120 x 750mg...

£19.99 £17.99

-10%

TMG Supplement

Potent methyl donor support for NMN Over 99% PureTMG Independently lab tested Gluten-free, vegan and allergy friendly 120 x 750mg...

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (1)

Updated on November 16, 2024- Updated by Jody Mullis
Medically reviewed by Dr. Sidra Samad

  • Discover glycine, a non-essential amino acid that supports protein synthesis. Explore its benefits, recommended dosage, potential side effects, and more.

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (2)

What is glycine? It’s a question worth exploring, especially if you’re interested in how this humble amino acid can impact our health. Glycine is one of the smallest amino acids, but don’t let its size fool you—it plays a significant role in several crucial functions, from supporting our nervous system to aiding in amino acid synthesis. Glycine is also known for its anti-inflammatory effects and its ability to protect tissues, making it valuable for joint, skin, and metabolic health. While glycine is synthesised naturally in the body, adding it through diet or supplements can enhance its benefits, particularly for those focused on longevity and cellular health.

Glycine serves as both a neurotransmitter and a building block for proteins, interacting with glycine receptors to regulate brain function and supporting collagen synthesis to keep our skin and joints in shape. In fact, research on glycine supplements has also shown potential benefits for improving sleep and cognitive function, which may be connected to glycine’s role as an inhibitory neurotransmitter. This amino acid does more than just support relaxation, though. Its functions extend to areas like detoxification and cellular repair, adding a layer of protection that is essential for ageing well.

At Longevity Box, we take pride in providing pure, third-party-tested supplements free from fillers, helping over 100,000 satisfied customers optimise their health journeys. Our commitment to transparency and quality means you’re getting only the finest ingredients, with a 700-day purity guarantee and certifications to match.

Looking to understand the full impact of glycine on your health? Dive into our comprehensive guide on its benefits, safety, and how to make it part of your wellness routine.

What is Glycine?

Glycine is classified as a non-essential amino acid, meaning that while our bodies can produce it, we also supplement its levels through diet and glycine supplementation when needed. As the smallest amino acid, glycine’s simple structure allows it to participate in various bodily processes, from collagen synthesis to support the nervous system. Glycine is an amino acid involved in numerous functions; it plays a structural role in the formation of proteins, especially collagen, which is critical for skin elasticity and joint health. Additionally, glycine acts as an important neurotransmitter that regulates mood, sleep, and overall brain health.

But glycine’s benefits don’t stop there. It also helps protect cells from oxidative stress by forming glutathione, a powerful antioxidant. This combination of functions makes glycine’s role significant in maintaining both cellular health and longevity. By supporting neurotransmission, connective tissue, and cellular repair, glycine plays a multi-faceted role in promoting health, making it a valuable part of many diets and wellness regimens.

Key Roles of Glycine:

  • Supports collagen production for skin and joint health
  • Functions as a neurotransmitter, aiding sleep and cognitive well-being
  • Forms glutathione, an antioxidant that protects cells from damage
  • Involved in detoxification pathways within the liver

How Does Glycine Work?

Glycine operates through several mechanisms that impact both the nervous system and cellular health. Primarily, glycine acts as a neurotransmitter in the central nervous system, where it serves as an inhibitory neurotransmitter by calming the nervous system, which can contribute to better sleep and mood stability. Glycine also works alongside glutamic acid to enhance excitatory responses, thus influencing memory and alertness.

The glycine transporter system, including glycine transporter 2, moves glycine across cell membranes, allowing it to reach specific sites where it’s most needed. Within cells, glycine synthesis and the glycine cleavage system work together to maintain amino acid balance, supporting efficient cellular function. Through these processes, glycine plays a role in cellular longevity and neuroprotection by supporting neurotransmitter function and cellular repair.

Mechanisms of Glycine:

  • Regulates neurotransmitter activity to support relaxation and cognitive health
  • Interacts with glycine transporters to manage intracellular glycine levels
  • Participates in the glycine cleavage system to balance amino acids within cells
  • Influences glutathione production, protecting cells from oxidative stress

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (3)

Potential Health Benefits of Glycine

Cognitive Health and Sleep Support

Glycine’s role as an inhibitory neurotransmitter supports cognitive health by helping to calm the nervous system. Studies have demonstrated that taking glycine before bed may lead to deeper, more restful sleep, which contributes to improved cognitive function and mood stability. With its effects on neurotransmission, glycine may also reduce overstimulation, supporting overall mental well-being.

Key Benefits for Cognitive Health and Sleep:

  • Improves relaxation and sleep quality
  • Supports mood regulation and mental clarity
  • May assist in reducing sleep disturbances

Joint Health and Skin Elasticity

One of glycine’s primary roles is in collagen synthesis, which is essential for joint flexibility and skin elasticity. Amino acid glycine is integral to collagen synthesis, which is crucial for maintaining skin elasticity and joint resilience. A study published in Amino Acids investigated the effects of glycine on collagen production by articular chondrocytes. The research demonstrated that increased glycine concentrations significantly enhanced collagen synthesis, suggesting that glycine availability is a limiting factor in collagen production.

As a result, glycine may support healthy ageing by reducing visible signs of ageing and promoting joint comfort.

Key Benefits for Joint and Skin Health:

  • Promotes collagen formation for skin and joint support
  • Helps maintain skin elasticity and youthfulness
  • Contributes to joint flexibility and comfort

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (4)

Metabolic Health and Cellular Protection

Glycine plays a significant role in supporting metabolic health by participating in glucose metabolism. It helps maintain steady blood sugar levels and provides cellular protection through anti-inflammatory effects. A study published in Nutrients explored glycine's involvement in metabolic pathways, highlighting its necessity for glutathione synthesis and regulation of one-carbon metabolism. The research indicated that adequate glycine levels are essential for maintaining metabolic homeostasis and preventing imbalances associated with conditions like obesity and type 2 diabetes

Key Benefits for Metabolic and Cellular Health:

  • Supports glucose and fat metabolism for stable energy
  • Protects cells from oxidative stress and inflammation
  • Contributes to cellular repair and healthy ageing

Glycine’s versatility and ease of use make it a valuable amino acid for supporting cognitive health, joint flexibility, metabolic function, and cellular integrity. Whether through diet or supplementation, glycine’s beneficial effects can positively influence various aspects of health and longevity.

Potential Risks and Side Effects of Glycine

While glycine is generally well-tolerated and regarded as safe for most people, it’s still important to understand its potential side effects, especially if taking high-dose glycine. Mild side effects have been reported with excessive intake, such as stomach upset, nausea, and drowsiness. For those using glycine to aid sleep, these side effects may be more noticeable, so starting with lower doses is advised.

Since glycine acts as an inhibitory neurotransmitter, it can potentially interact with medications that affect the nervous system, like sedatives or antipsychotics, due to its calming effect on the brain. Glycine potentiates the NMDA response, meaning it can enhance the effects of other compounds that influence the nervous system. To avoid adverse interactions, individuals with neurological or psychiatric conditions should consult a healthcare provider before beginning glycine treatment.

While rare, some serious side effects may occur with extremely high doses. Studies suggest that keeping within the recommended intake range maximises the beneficial effect of glycine without causing harm. This supports its safe use as a supplement for general wellness and longevity.

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (5)

Dietary and Natural Sources of Glycine

Glycine is a non-essential amino acid, which means our bodies produce it, though dietary sources can still help boost its levels. Foods high in protein, such as meat, fish, dairy products, and legumes, contain glycine naturally. Bone broth is an especially rich source due to the collagen extracted during the cooking process, which is rich in amino acids, including glycine. While glycine synthesis within the body is typically sufficient, there are instances where extra dietary glycine may be beneficial, such as for those aiming to support joint health or improve sleep quality.

A balanced diet with sufficient protein sources typically provides enough glycine for amino acid metabolism. However, those with specific health goals, like promoting skin elasticity or supporting cellular health, might find it helpful to supplement with glycine to achieve higher levels.

Common Foods Rich in Glycine:

  • Meat (especially pork and poultry)
  • Fish and seafood
  • Dairy products like milk and cheese
  • Legumes such as soybeans and lentils
  • Bone broth

These foods contribute to maintaining optimal glycine concentration within the body, supporting daily metabolic and cellular functions.

Supplements and Dosage of Glycine

Glycine, a vital amino acid, is known for its versatile health benefits, from enhancing sleep quality to supporting cellular and metabolic health. For general wellness, glycine supplementation typically ranges from 1 to 3 grams per day, commonly in powder or capsule form. Many people take glycine before bed due to its ability to promote deeper, more restful sleep, while others use it for joint and skin health or even cellular repair.

Research also highlights glycine's role in metabolic support and cognitive function, particularly at higher doses. However, for anyone considering doses above the standard range, it’s recommended to consult a healthcare provider to ensure safe and effective use.

Glycine supplements come in various forms to suit different preferences:

  • Powder: Easily mixed into beverages, providing flexible dosing options.
  • Capsules: Ideal for convenient, precise dosing.
  • Tablets: Another option for accurate intake.

The Role of Glycine in GlyNAC from Longevity Box

Glycine is a central ingredient in, where it combines with N-Acetylcysteine (NAC) to support cellular health and longevity. This combination is particularly beneficial, as glycine and NAC work synergistically to boost glutathione levels, one of the body’s key antioxidants. Together, these two amino acids promote detoxification, reduce oxidative stress, and support mitochondrial health, making GlyNAC a well-rounded choice for those focused on proactive wellness.

In GlyNAC, glycine’s ability to promote cellular repair and support restful sleep complements NAC’s detoxifying effects. This powerful duo not only enhances antioxidant defences but also helps maintain balanced energy levels, making it ideal for individuals who want to optimise their cellular health and overall vitality.

Suggested Dosage for Glycine Supplementation:

  • General Health: 1–3 grams daily, taken in powder or capsule form
  • Sleep and Relaxation: Glycine before bed may aid in promoting restful sleep
  • Higher Doses: Consult a healthcare provider if considering higher intake for targeted benefits in cellular repair or cognitive function
  • Supplement Options: Powder for flexible dosing, capsules for convenience, and tablets for accurate intake

By incorporating glycine as part of a balanced supplement routine, offers targeted support for those seeking to enhance cellular health and longevity. The synergy between glycine and NAC makes GlyNAC a thoughtfully designed supplement for anyone invested in maintaining a healthy, balanced approach to wellness. For personalised guidance, consulting a healthcare provider is recommended to determine the best dosage for individual health goals.

Conclusion

Glycine stands out as a foundational essential amino acid for humans that’s deeply involved in maintaining health on multiple fronts. As glycine improves neurotransmitter function and supports collagen production, it shows itself to be more than just a simple protein builder. Glycine can also help regulate mood and sleep as it functions as an inhibitory neurotransmitter, helping the body maintain balance. With its role in glycine biosynthesis and glycine cleavage enzyme activity, glycine effectively contributes to cellular repair, detoxification, and protection against oxidative stress.

In various studies, treatment with glycine has shown promising results for metabolic health, while supplementation with glycine reduces markers of inflammation, suggesting long-term benefits for joint, skin, and cellular health. Glycine therapy has been explored for its potential in metabolic health, and glycine supplements may offer a valuable boost for those whose diets may fall short in glycine-rich foods. The anti-inflammatory effects of glycine have been reported, demonstrating its protective qualities and unique ability to support health across multiple systems.

For those considering grams of glycine per day through supplementation, it’s important to stay within recommended limits, as high doses could carry risks, although glycine is also used safely in common therapeutic practices. Glycine’s ability to enhance cellular health and support longevity makes it an ideal addition for anyone focusing on proactive wellness and healthy ageing.

If you’re interested in learning more about the effect of glycine supplementation and how it could support your well-being, explore our complete guide on glycine at Longevity Box.

FAQ

1, How does glycine protect the body?

Glycine protects cells by supporting antioxidant production and reducing inflammation. Studies have demonstrated that glycine has anti-inflammatory effects, which may help protect tissues from oxidative stress.

2. What is the main function of glycine in the body?

Glycine function includes acting as a neurotransmitter and aiding in protein synthesis. It is an amino acid that helps with collagen production, cellular repair, and neurotransmission, making it essential for skin, joint, and nervous system health.

3. Are there any harmful effects associated with glycine?

Generally, glycine is well-tolerated, but very high doses might lead to mild side effects like nausea or drowsiness. Some research suggested that glycine could interact with other medications affecting the nervous system, so it’s best to consult a healthcare provider.

4. How does glycine work with other amino acids?

Glycine often works along with other amino acids like cysteine and glutamine to form glutathione, an important antioxidant. It can also be bound to other amino acids in protein synthesis, supporting cellular health and detoxification.

5. Does glycine affect alcohol metabolism?

Yes, studies have shown that glycine has an effect on alcohol by potentially reducing liver damage due to its protective and antioxidant properties, helping to reduce oxidative stress in liver cells.

6. Why is glycine considered an inhibitory neurotransmitter?

Glycine is an inhibitory neurotransmitter because it calms the nervous system, reducing overstimulation by helping regulate nerve signals in the brain and spinal cord.

7. What is the importance of glycine uptake and distribution in the body?

Glycine uptake is essential for its effectiveness, as it needs to reach cells efficiently. Glycine transport helps its distribution across tissues, ensuring its benefits reach areas where it aids in repair, anti-inflammation, and cellular protection.

Posted by Jody Mullis on Nov 2024 16

Recommended product

NAD+ Boosters

NMN and NR arethemost popular NAD supplements on the market, but which one is most effective? The experts disagree on...

£133.99

Sold Out

NMN and NR arethemost popular NAD supplements on the market, but which one is most effective? The experts disagree on...

Pure NMN Supplement

NAD+ Boosters

Ultra Pure NMN Powder Our ultra-pure NMN powder is third-party tested, offering super-high potency and 99% purity. It is manufactured...

£54.99

Sold Out

Pure NMN Supplement

Ultra Pure NMN Powder Our ultra-pure NMN powder is third-party tested, offering super-high potency and 99% purity. It is manufactured...

Pure NMNH Supplement

NAD+ Boosters

Ultra Pure NMNH Our ultra-pure NMNH is third-party tested, offering super-high potency and 99% purity. It is manufactured in a...

£59.99

Sold Out

Pure NMNH Supplement

Ultra Pure NMNH Our ultra-pure NMNH is third-party tested, offering super-high potency and 99% purity. It is manufactured in a...

The Ultimate NAD Support Bundle

Immune Support

Introducing our ultimate stack to boost NAD levels: NR Apigenin TMG Save 25% when you buy as a bundle! NR...

£82.97 £61.99

-25%

The Ultimate NAD Support Bundle

Introducing our ultimate stack to boost NAD levels: NR Apigenin TMG Save 25% when you buy as a bundle! NR...

`; newComponent.style.position = 'absolute'; newComponent.style.top = 'calc(50% - 10px)'; newComponent.style.right = '75%'; cartButtonClone.appendChild(newComponent); // check in 3 seconds, if UPEZ Cart doesn't show up, go to the cart page setTimeout(() => { if (!document.querySelector('#upezCart.builder-loaded')) { window.location.href = '/cart'; } }, 3000); } }) }; cartButtons.forEach(e=>{let t=e.cloneNode(!0);e.insertAdjacentElement("beforebegin",t),e.remove(),t.setAttribute("data-upez-cart","upez"),t.addEventListener("click",window.onWaitForUPEZCartToOpen)}); window.builderNoTrack = true; })

`;else{let r=this.shadowRoot.querySelector("img");return r.setAttribute("src",s?t:i),s||r.parentElement.classList.add("upez--shine"),new Promise(e=>{r.onload=e})}}getLowResolution(e){let t=new URL(e.replace(/^\/\//,"https://"));return t.searchParams.set("width","20"),t.toString()}observeIntersection(){if("IntersectionObserver"in window){let e=new IntersectionObserver(t=>{t.forEach(t=>{if(t.intersectionRatio>0){let s=this.shadowRoot.querySelector("img");s.setAttribute("src",this.getAttribute("src")),this.handleImageLoad(),e.unobserve(this)}})},{rootMargin:"0px",threshold:.1});e.observe(this)}else{let t=this.shadowRoot.querySelector("img");t.setAttribute("src",this.getAttribute("src"))}}handleImageLoad(){let e=this.shadowRoot.querySelector("img"),t=()=>{__loadedImages.push(e.getAttribute("src")),e.style.opacity=1,e.parentElement.classList.remove("upez--shine"),e.removeEventListener("load",t)};e.addEventListener("load",t)}}customElements.define("shopify-img",ShopifyImg); window.addEventListener('click',(e)=>{try{const clickedElement=e.target;const anchorElement=clickedElement.closest('a[href*="/products"]');if(anchorElement){const flowContainer=clickedElement.closest('[upez-flow-handle]');if(flowContainer){const flowId=flowContainer.getAttribute('upez-flow-handle');let visits=[];try{visits=JSON.parse(sessionStorage.getItem('upez__visits'))||[]}catch(e){} sessionStorage.setItem('upez__visits',JSON.stringify([...visits,{flowId,productHandle:anchorElement.href.split('/products/')[1].split('?')[0],}]))}}}catch(e){}}) // formatMoney window.upez__formatMoney = Intl.NumberFormat(`${window.Shopify.locale}`, { style: 'currency', currency: window.Shopify.currency.active, trailingZeroDisplay:"stripIfInteger" }).format; window.UPEZ = { openCart: () => {var _document$querySelect;null===(_document$querySelect=document.querySelector("#upezCart"))||void 0===_document$querySelect||_document$querySelect.builderPageRef.state.state.openCart()}, deepCompare: (e,t)=>e===t||(null===e||null===t?e===t:typeof e==typeof t&&("string"==typeof e&&"string"==typeof t?e===t:Array.isArray(e)?e.length===t.length&&e.every((e,y)=>window.UPEZ.deepCompare(e,t[y])):"object"==typeof e?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(y=>window.UPEZ.deepCompare(e[y],t[y])):e?.constructor?.name==="Date"?e.getTime()===t.getTime():!!(isNaN(e)&&isNaN(t))||e===t)), // scripts/cart-builder.ts#1 memoize: (e,n,r={})=>{let t=[];return(...r)=>{let l=n(...r),s=t.find(e=>r.length===e.args.length&&r.every((n,r)=>window.UPEZ.deepCompare(n,e.args[r]))&&l.length===e.dependencies.length&&l.every((n,r)=>window.UPEZ.deepCompare(n,e.dependencies[r])));if(s)return s.result;let d=e(...r);return t.push({args:r,result:d,dependencies:l}),d}} // scripts/cart-builder.ts#38 }; let __tempProduct = {}; window.upezOnLoadCallbacks = window.upezOnLoadCallbacks || []; function enrichCartItem(cartItem) { return (cartItem.product_id === window.UPEZ__CURRENT_PRODUCT?.id) ? { ...cartItem, in_collections: window.UPEZ__CURRENT_PRODUCT.in_collections } : cartItem; } window.upezOnLoadCallbacks.push(() => { window.UPEZ_INITIAL_CART = {"note":null,"attributes":{},"original_total_price":0,"total_price":0,"total_discount":0,"total_weight":0.0,"item_count":0,"items":[],"requires_shipping":false,"currency":"GBP","items_subtotal_price":0,"cart_level_discount_applications":[],"checkout_charge_amount":0}; window.UPEZ__CART_EXPANDED = {}; var searchParams = parseQueryString(window.location.search); if (searchParams['clear_upez_cache']) { const keys = []; for (let i = 0; i < sessionStorage.length; i++) { const key = sessionStorage.key(i); if (key.includes('upez')) { keys.push(key); } } keys.forEach((key) => sessionStorage.removeItem(key)) } window.addEventListener('submit', (e) => { if (e.target.tagName === 'FORM') { const form = e.target; if (form.action.includes('/cart/add')) { e.preventDefault(); const data = serialize(form); window.UPEZ_INITIAL_CART = undefined; !window.UPEZ__DISABLE_FORM_LISTENER && fetch('/cart/add.js?app=upez', { method: 'POST', body: data, credentials: 'same-origin', headers: {'Content-Type': 'application/x-www-form-urlencoded','X-Requested-With': 'XMLHttpRequest'} }) if (window.onWaitForUPEZCartToOpen) { window.onWaitForUPEZCartToOpen(); } return false; } } }); let __upez_oldXHROpen = window.XMLHttpRequest.prototype.open; window.XMLHttpRequest.prototype.open = function(method, url, ...args) { if (url.includes('/cart/add')) { window.UPEZ__ADDING_TO_CART = [...(window.UPEZ__ADDING_TO_CART || []), true]; this.addEventListener('load', function() { window.UPEZ__ADDING_TO_CART.pop(); let addedItem = {}; try { const addedProducts = JSON.parse(this.responseText); addedItem = enrichCartItem(addedProducts.items ? addedProducts.items[0] : addedProducts); document.dispatchEvent(new CustomEvent('UPEZ__ADDED_ITEM', { detail: { addedItem: addedItem } })); } catch (error) { console.error(error); } fetch(`/cart.json?app=upez`) .then(async (res) => { document.dispatchEvent(new CustomEvent('UPEZ__CART_REFETCHED_AFTER_ADD', { detail: { addedItem: addedItem } })); const cart = await res.json(); document.dispatchEvent(new CustomEvent('UPEZ__CART_REFETCHED_AFTER_CHANGE', { detail: { cart } })); if (!url.includes('hide_upez_cart=true')) { if (document.querySelector('#upezCart')) {document.querySelector('#upezCart').builderPageRef.state.state.openCart();} } }) }); } return __upez_oldXHROpen.apply(this, [method, url.includes('cart/add.js') ? url : url.replace('cart/add', 'cart/add.js'), ...args]); } var upez__originalFetch = window.fetch; window.UPEZ__LAST_CART_ATTRIBUTE = ''; window.fetch=function(){let[url,...argRest]=arguments;while(!!url&&typeof url!=='string'){url=url.url}if(!searchParams.clear_upez_cache){if(url&&/cdn\.builder\.io\/api\/v\d\/query/.test(url)){const cachedResult=getBuilderCache(url);if(cachedResult){const res={url:url,bodyUsed:!1,headers:new Headers(),redirected:!1,type:'basic',json:()=>Promise.resolve(replacePixel(cachedResult)),ok:!0,status:200,statusText:"",text:()=>Promise.resolve(JSON.stringify(cachedResult)),clone:()=>res};return Promise.resolve(res)}const templateId=url.split('?')[0].split('/').pop();if(templateId&&window.UPEZ_BUILDER_DATA&&window.UPEZ_BUILDER_DATA[templateId]){console.debug(`fetched from cache for template ${templateId}`);const res={url:url,bodyUsed:!1,headers:new Headers(),redirected:!1,type:'basic',json:()=>Promise.resolve(replacePixel(window.UPEZ_BUILDER_DATA)),ok:!0,status:200,statusText:"",text:()=>Promise.resolve(JSON.stringify(replacePixel(window.UPEZ_BUILDER_DATA))),clone:()=>res}return Promise.resolve(res)}return upez__originalFetch.apply(window,[`https://upez-frontend.vercel.app/api/component/${url.split('/').pop()}`,...argRest]).then(async response=>{if(response.ok){return response}return Promise.reject('UPEZ: Loading cache failed')}).catch(error=>{console.debug('UPEZ: cache not found',error);return upez__originalFetch.apply(window,[url+'&cachebust=true',...argRest])}).then(async response=>{if(response.ok){const data=replacePixel(await response.clone().json());try{processBuilderResponse(data,url)}catch(error){console.debug('UPEZ: Skipped saving',error)}response.json=()=>Promise.resolve(data)}return response}).catch(error=>{console.error('Loading builder failed: ',error)})}}if(url&&url.includes('/cart/add')){window.UPEZ__ADDING_TO_CART=[...(window.UPEZ__ADDING_TO_CART||[]),!0];window.UPEZ_OPEN_CART_WHEN_LOAD=!0;window.UPEZ_INITIAL_CART=undefined;const options=arguments[1];const cP=window.UPEZ__CURRENT_PRODUCT;try{let flowVisits=[];try{flowVisits=JSON.parse(sessionStorage.getItem('upez__visits'))||[]}catch(e){}if(options.headers['Content-Type']==='application/json'){const body=JSON.parse(options.body);const item=Array.isArray(body)?body[0]:body;item.properties=item.properties||{};if(cP?.variants.map(({id})=>id.toString()).includes(item.id.toString())){const flow=flowVisits.find(({productHandle})=>productHandle===cP.handle)flow?.flowId&&(item.properties.__upez_flow=flow.flowId)}}else{if(options.body instanceof FormData){if(cP?.variants.map(({id})=>id.toString()).includes(options.body.get('id'))){const flow=flowVisits.find(({productHandle})=>productHandle===cP.handle)flow?.flowId&&options.body.append('properties[__upez_flow]',flow.flowId)}}else if(options.headers['Content-Type']==='application/x-www-form-urlencoded'){const body=parseQueryString(options.body);if(cP?.variants.map(({id})=>id.toString()).includes(body.id)){const flow=flowVisits.find(({productHandle})=>productHandle===cP.handle)flow?.flowId&&(body['properties[__upez_flow]']=flow.flowId);options.body=Object.entries(body).map(([key,value])=>`${key}=${encodeURIComponent(value)}`).join('&')}}}}catch(error){}return upez__originalFetch.apply(window,[arguments[0],options]).then(res=>{window.UPEZ__ADDING_TO_CART.pop();return res})}window.UPEZ__ACTIVATE_CART_ATTRTIBUTES=!0;if(url&&(url.includes(`/cart/change`)||url.includes(`/cart.json?app=upez`))){return upez__originalFetch.apply(window,arguments).then(async(res)=>{if(res.ok){const cart=await res.clone().json();if(cart.attributes&&(cart.attributes.__upez_total_discount!==cart.total_discount)){const discountedItems=cart.items.filter(i=>i.discounts.length>0).map(i=>`${i.id}-${i.product_id}:${i.quantity}:${i.discounts[0].title}:${i.discounts[0].amount}`).join(';;');if(!window.UPEZ__ADDING_TO_CART||!window.UPEZ__ADDING_TO_CART.length){const newAttribute=encodeURIComponent(discountedItems);if(newAttribute!==window.UPEZ__LAST_CART_ATTRIBUTE){fetch(`${window.Shopify.routes.root || '/'}cart/update.js?attributes[__upez_discounted_items]=${newAttribute}`,{method:'POST',});window.UPEZ__LAST_CART_ATTRIBUTE=newAttribute}}}}return res})}return upez__originalFetch.apply(window,arguments)} }); function initiateUPEZ() { if (!window.isUPEZLoaded) { window.isUPEZLoaded = true; window.upezOnLoadCallbacks.forEach((cb) => cb()); } } initiateUPEZ(); function queryToString(obj) { return obj && Object.entries(obj).map(([key, value]) => `${key}=${encodeURIComponent((value === null || value === void 0 ? void 0 : value.toString()) || "")}`).join('&') } function getCacheKeyFromURL(e=""){let[t,l]=e.split("/").pop().split("?").map(decodeURIComponent),p=t.split(":"),s=3===p.length,i=s?l.replaceAll(`:${[...p].pop()}`,""):l,n=s?p.slice(0,2).join(":"):t,r=new Map([...new URLSearchParams(i)]);r.set("userAttributes.urlPath","/");let o=[...r.keys()].sort((e,t)=>e>t?1:-1).map(e=>`${e}=${encodeURIComponent(r.get(e))}`).join("&");return`upez.${n}?${o}`} function getBuilderCache(e){let[t,r]=e.split("/").pop().split("?").map(decodeURIComponent),l=t.split(":"),i=3===l.length;try{let n=sessionStorage.getItem(getCacheKeyFromURL(e));if(!n)return null;let s=JSON.parse(n);if(i){let a=Object.keys(s)[0];if(a&&a.startsWith(l.slice(0,2).join(":"))){let c=l.slice(0,2).join(":")+":"+l.at(-1);if(c!==a)return s[c]=s[a],delete s[a],s;return s}}}catch(p){console.error("UPEZ: Error parsing cache",p)}return null} function processBuilderResponse(data, url) { sessionStorage.setItem(getCacheKeyFromURL(url), JSON.stringify(data)) } function replacePixel(o){if(!o)return o;if(Array.isArray(o)){return o.map(item=>replacePixel(item))}if(typeof o==='object'){const newObj={};for(const key of Object.keys(o)){newObj[key]=replacePixel(o[key])}return newObj}if(typeof o==='string'){return o.replace(/https:\/\/cdn\.builder\.io\/api\/v\d\/pixel\?apiKey=[a-z0-9]+/,'https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png')}return o}

What is Glycine Amino Acid? Benefits, Dosage, and Side Effects (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Corie Satterfield

Last Updated:

Views: 5349

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Corie Satterfield

Birthday: 1992-08-19

Address: 850 Benjamin Bridge, Dickinsonchester, CO 68572-0542

Phone: +26813599986666

Job: Sales Manager

Hobby: Table tennis, Soapmaking, Flower arranging, amateur radio, Rock climbing, scrapbook, Horseback riding

Introduction: My name is Corie Satterfield, I am a fancy, perfect, spotless, quaint, fantastic, funny, lucky person who loves writing and wants to share my knowledge and understanding with you.