TryMe for developers

Three ways in, depending on how much control you want.

The widget

One script tag. TryMe decides whether to show an offer and renders it in a shadow root, so your CSS cannot break it and its CSS cannot leak into your page.

<div data-tryme-offer></div>
<script async src="https://tryme.com/assets/widget.js" data-merchant="your-slug"></script>

The SDK

Same decision, your markup. Ask what to show and place it yourself.

<script async src="https://tryme.com/assets/sdk.js" data-merchant="your-slug"></script>
<script>
  window.addEventListener('load', async () => {
    const offer = await window.tryme.decide({ campaignType: 'product_page' });
    if (offer) location.assign(window.tryme.claimUrl(offer));
  });
</script>

The widget and the SDK hold no API key and cannot be given one. Anything shipped to a page is public. They call the shopper endpoints with your public slug; keys are for server-to-server calls only.

The API

For headless and custom storefronts. Send events, ask for a decision, create claims. Start here.