Secure HTML Ad Richmedia Container (SHARC) β IAB Tech Lab protocol reference implementation.
π This repository is the current SHARC reference implementation and working specification set. It is in active pre-1.0 development at package version
0.7.1and is not yet published to npm. Start with the curated docs index at docs/README.md and the current state summary at docs/current-status.md.
SHARC is a secure container API for managed communication between a publisher-controlled container (iframe or WebView) and a served ad creative.
Goal: Write one ad; serve it across supported SHARC environments.
The current v1 reference implementation targets web iframes, iOS WKWebView, and Android WebView. Future scope such as CTV is discussed in design material, but is not part of the current supported implementation surface.
The SHARC project hosts a reference deployment of the Creative Markup renderer for evaluation and integration testing:
- Hosted reference renderer:
https://jeffreycarlson.github.io/SHARC/renderer/β test/dev only; the SDK refuses to load this URL from production origins via theKNOWN_TEST_RENDERERSproduction-block guard.
A local Creative Markup demo at examples/demos/creative-markup/ drives a 300Γ250 placement against the hosted renderer and prints every container-side event (security events, errors, navigation requests, state changes, port handshake) to a live log:
git clone https://github.com/jeffreycarlson/SHARC.git
cd SHARC
npm install
npm run build
node server.cjs
# open http://localhost:8765/examples/demos/creative-markup/index.htmlThe demo runs locally rather than on Pages because Pages would put the demo and renderer on the same origin, collapsing the cross-origin requirement (validation rule 7 β see Renderer Ownership Model). Operators evaluating SHARC for production must fork examples/renderer/index.html and self-host on operator-controlled infrastructure.
- Today: build from this repository and use the
dist/artifacts locally. - After first npm publish: install
@iabtechlab/sharcand use the same subpath entry points shown below.
npm install @iabtechlab/sharcimport { SHARCContainer } from '@iabtechlab/sharc/sharc-container';
import { SHARC } from '@iabtechlab/sharc/sharc-creative';All public entry points ship generated .d.ts declarations, so TypeScript consumers get full IntelliSense and argument-shape checking on every subpath import β no separate @types package required.
<script src="./dist/sharc-protocol.js"></script>
<script src="./dist/sharc-container.js"></script>
<script src="./dist/sharc-creative.js"></script>Browser globals:
window.SHARC.Containerβ container constructorwindow.SHARCβ creative API surface (onReady,onStart,requestNavigation, etc.)
SHARC is packaged as one npm package with versioned subpath exports:
- Container:
@iabtechlab/sharc/sharc-container - Creative:
@iabtechlab/sharc/sharc-creative - Protocol:
@iabtechlab/sharc/sharc-protocol - Bridges:
@iabtechlab/sharc/sharc-mraid-bridge,@iabtechlab/sharc/sharc-safeframe-bridge,@iabtechlab/sharc/sharc-omid-bridge
All public entry points build into dist/ as ESM (.mjs) plus browser/IIFE bundles (.js).
After the package is published, public CDN URL patterns should mirror the current dist/ filenames:
- Container:
https://cdn.jsdelivr.net/npm/@iabtechlab/sharc@0.7.1/dist/sharc-container.js - Creative:
https://cdn.jsdelivr.net/npm/@iabtechlab/sharc@0.7.1/dist/sharc-creative.js - Protocol:
https://cdn.jsdelivr.net/npm/@iabtechlab/sharc@0.7.1/dist/sharc-protocol.js
Versioning guidance:
- Production: pin exact semver, for example
@1.2.3 - Dev/staging: floating minor or major aliases are acceptable, for example
@1.2or@1 - Do not rely on
latestfor production integrations or long-lived test environments
Bridge public CDN URL policy is intentionally deferred for now. Treat bridge bundles as package artifacts used by SHARC, not as separately documented public CDN entry points yet.
Start with the curated index, then dive into specifics:
- Docs index β curated guide to authoritative, maintainer, and archive material
- Current status β what's stable, what's pre-publish, current package version
- API reference β detailed protocol and public API reference
The docs index lists everything else (architecture overview, bridge designs, change log, reviews, proposals).
SHARC/
βββ src/ # Reference implementation source
βββ dist/ # Built modules (ESM + browser/IIFE)
βββ docs/ # Specification, design, review, and research material
βββ test/browser/ # Browser test harness and reference creatives
βββ test/node/ # Node-based regression tests (npm run test:*)
βββ test/types/ # Type-consumer verification
βββ examples/ # Wrappers, bridge demos, and compliance vectors
βββ CHANGELOG.md # Version history
βββ SECURITY.md # Security reporting and support policy
βββ README.md # This file
The repository includes a local browser test harness for development:
npm run dev
# or: node server.cjsMain entry points:
http://localhost:8765/test/browser/index.htmlβ core SHARC harnesshttp://localhost:8765/test/browser/mraid-test.htmlβ MRAID bridge harnesshttp://localhost:8765/test/browser/safeframe-test.htmlβ SafeFrame bridge harnesshttp://localhost:8765/examples/demos/omid-integration/index.htmlβ OMID bridge integration page
Use ?build=dist on the core harness to exercise built artifacts:
http://localhost:8765/test/browser/index.html?build=distWe welcome contributions! Please see our Contributing Guidelines and the Architecture Overview before submitting changes.
For security concerns, please see our Security Policy.
SHARC is licensed under the Apache License 2.0.
For questions or to get involved, email support@iabtechlab.com.
IAB Tech Lab | iabtechlab.com