Skip to Content

Embed the viewer on a product page

Read an article, paste the viewer snippet into your product template and show the 3D viewer and AR on your shop.

You end up with the 3D viewer and AR on your product page, keyed on the article number you already use. The snippet is safe to add to every product page, because the viewer stays hidden until the model is delivered.

Read the article

GET/api/v1/assets/{article}assets:read
curl -sS https://platform.charpstar.co/api/v1/assets/CH-1001 \
  -H "Authorization: Bearer $CHARPSTAR_API_KEY"
  • status is received, in_production, in_review, approved or delivered. Links are null until the product is delivered.
  • embed is null until then. Once the article is delivered, embed.dataClient is your data-client value and embed.snippet holds the snippet for this article.

Paste the snippet into the product template

Product page
<script src="https://js.charpstar.net/V2/charpstAR-Base.js" data-client="YourCompany" defer></script>
<charpstar-viewer data-articleid="CH-1001"></charpstar-viewer>
Resultlive from our Demo companyOpen
The viewer the snippet puts on your page, shown here through its hosted link. Drag to turn the model.
  • data-client is your company's delivery name, the same on every page of your shop.
  • data-articleid is the article number, exactly as you sent it in articleId.
  • Until a product is delivered, the tag shows nothing: no empty box, no error. Once it is delivered, the viewer shows up by itself, with a button to see it in AR.

Use the Shopify version

In your theme editor, add a Custom Liquid block to the product template:

{%- assign cs_article = product.selected_or_first_available_variant.sku -%}
{%- if cs_article != blank -%}
<script src="https://js.charpstar.net/V2/charpstAR-Base.js" data-client="YourCompany" defer></script>
<charpstar-viewer data-articleid="{{ cs_article | escape }}" style="display:block;width:100%;height:480px"></charpstar-viewer>
{%- endif -%}

This works when your SKU is the same article number you send us.

On this page