API Reference

🌐

Web SDK Reference

Adobe Experience Platform Web SDK — known as Alloy — is the modern replacement for at.js. A single library handles Adobe Target, Analytics, and more through the unified Adobe Edge Network.

Web SDK vs at.js — key differences

Aspectat.jsWeb SDK (Alloy)
Library scopeAdobe Target onlyTarget, Analytics, Experience Platform, more
Network requestsTo *.tt.omtrdc.netTo *.adobedc.net (Edge Network)
JavaScript objectadobe.target.*alloy('command', {...})
SPA supportat.js 2.x requiredBuilt-in
Data layermbox parametersXDM schema (Experience Data Model)
Setup complexityLower — drop-in scriptHigher — requires datastream config

Installation

1

Create a Datastream in Adobe Experience Platform

Data Collection → Datastreams → New Datastream. Add Adobe Target as a service. Copy the Datastream ID — you'll need it in the configure command.

2

Install the alloy.js library

Either via npm (npm install @adobe/alloy) and import it, or via the CDN snippet. The CDN snippet creates the alloy() function synchronously before the script fully loads.

3

Configure Alloy

Call alloy('configure', {...}) once, before any other alloy commands. Pass your datastreamId, orgId (your IMS Org ID), and any optional settings.

4

Send the page-view event

Call alloy('sendEvent', {...}) with renderDecisions: true on page load. This retrieves Target personalisation decisions and applies VEC modifications automatically.

Command reference

configure

Must be called once before any other commands. Sets your organisation and datastream.

javascript
alloy("configure", {
  datastreamId: "YOUR_DATASTREAM_ID",
  orgId: "YOUR_IMS_ORG_ID@AdobeOrg",
  // Optional settings:
  debugEnabled: false,           // set true to see debug logs
  defaultConsent: "in",          // "in" | "out" | "pending"
  clickCollectionEnabled: true,  // auto-track link clicks
});

sendEvent

The main command — sends an event to the Edge Network. With renderDecisions: true it automatically applies Target personalisation (VEC modifications, Custom Code).

javascript
// Page-view event — call on every page load
alloy("sendEvent", {
  renderDecisions: true,
  xdm: {
    web: {
      webPageDetails: {
        name: "Home Page",
        URL: window.location.href,
      }
    },
    eventType: "web.webpagedetails.pageViews"
  }
});

getOffers

Retrieves personalisation decisions without automatically rendering them. Use when you need programmatic control over when modifications are applied.

javascript
alloy("getOffers", {
  request: {
    decisions: [{
      id: "target-global-mbox",
      type: "proposition",
      scopeDetails: { decisionProvider: "TGT" }
    }]
  }
}).then(result => {
  return alloy("applyPropositions", {
    propositions: result.decisions
  });
});

sendEvent — firing a conversion

javascript
// Fire a conversion event — call from your CTA click handler
alloy("sendEvent", {
  xdm: {
    eventType: "commerce.purchases",
  },
  data: {
    __adobe: {
      target: {
        "mbox-parameter-key": "value"
      }
    }
  }
});

Anti-flicker with Web SDK

web-sdk-anti-flicker.html
<!-- Place before alloy.js loads -->
<style>
  body { opacity: 0 !important }
</style>
<script>
  var hidingStyle = document.querySelector('style');
  alloy("sendEvent", { renderDecisions: true }).then(function() {
    if (hidingStyle) hidingStyle.remove();
  });
  setTimeout(function() {
    if (hidingStyle) hidingStyle.remove();
  }, 3000);
</script>

Migrating from at.js

⚠️Migration requires engineering involvement
Migrating from at.js to Web SDK is a significant implementation change — datastream setup, XDM schema mapping, and rewriting mbox parameter calls. It is not a drop-in replacement. Coordinate with your Adobe implementation consultant.

Experience Lab-generated scripts work without modification after a Web SDK migration. The VEC Custom Code execution model is identical — your scripts execute when Target applies the activity, regardless of which library delivers it.

For the full migration guide, see the Adobe Experience League documentation at experienceleague.adobe.com → Web SDK implementation guide.

🚀 Thinking about migrating? We can help.

Experience Lab offers hands-on Web SDK migration consulting — datastream setup, XDM schema design, and activity migration. Skip the guesswork.

Get in touch