githubEdit

Integrating with Adobe Experience Manager

Adobe Experience Manager (AEM) is an enterprise-grade content management system. This guide covers multiple approaches for integrating Needle Engine 3D content into AEM, from simple iframe embeds to advanced component-based integrations that content authors can manage.

Overview: Integration Approaches

Choose the approach that fits your AEM setup and authoring requirements:

Approach
Best For
Author-Friendly
Technical Complexity

Quick integration, isolated content

⭐⭐

Low

Authorable content, reusability

⭐⭐⭐⭐

Medium

Maximum control, custom layouts

⭐⭐⭐

Medium-High

Multi-channel content, reusability

⭐⭐⭐⭐⭐

Medium


Approach 1: iframe Embedding

Best for: Quick integration when you have limited access to AEM development resources.

This is the simplest approach and works with any AEM setup, including AEM as a Cloud Service.

Steps

  1. Deploy your Needle project to Needle Cloud or your preferred hosting platform

  2. Get your project URL

    https://your-project.needle.run/
  3. Add iframe to AEM page using one of these methods:

    Option A: Using the Embed Component (AEM Core Components)

    If your AEM site uses Core Components:

    • Drag the "Embed" component onto your page

    • Select "Embeddable" type

    • Paste your Needle project URL

    • Configure size and other options

    Option B: Using HTML in Text Component

    <iframe
        src="https://your-project.needle.run/"
        allow="xr; xr-spatial-tracking; fullscreen; accelerometer; gyroscope"
        style="width: 100%; height: 600px; border: none;"
        allowfullscreen>
    </iframe>

:::tip Get Embed Code from Needle Cloud Needle Cloud provides ready-to-use embed code. Open your project, click "Share", and copy the iframe snippet. :::

iframe Considerations

Pros:

  • ✅ No AEM development required

  • ✅ Works with any AEM version

  • ✅ Easy updates (just redeploy Needle project)

  • ✅ Content isolation

Cons:

  • ❌ Limited integration with page content

  • ❌ Less flexible sizing options

  • ❌ Authors can't edit 3D content properties in AEM


Approach 2: Custom AEM Component

Best for: Content authors who need to configure and manage 3D experiences directly in AEM.

Create a custom AEM component that allows authors to add and configure Needle Engine content through AEM's authoring interface.

Architecture Overview

Implementation Steps

1. Create the AEM Component

Create a new component in your AEM project:

Component Structure:

.content.xml (Component Definition):

2. Create the Author Dialog

_cq_dialog.xml (Author Interface):

3. Create the HTL Template

needle-engine.html (Component Rendering):

4. Add Client Library (Optional for Enhanced Features)

clientlibs/.content.xml:

clientlibs/js/needle-loader.js (Optional enhancements):

5. Deploy and Use

  1. Deploy the component to your AEM instance

  2. Add component to page template policy (if using editable templates)

  3. Authors can now:

    • Drag the "Needle Engine 3D" component onto pages

    • Configure project URL and options through the dialog

    • Preview in edit mode

    • Publish with the page

:::tip Content Workflow Recommended workflow: 3D artists update content in Unity/Blender → Export via Needle → Deploy to Needle Cloud → AEM authors update URL in component → Publish :::


Approach 3: Direct Web Component Integration

Best for: Custom AEM templates where you want full control over layout and integration with existing page JavaScript.

This approach embeds Needle Engine directly into AEM templates without using iframes.

Steps

  1. Add Needle Engine to your AEM clientlib

    /apps/myproject/clientlibs/clientlib-site/js.txt:

    /apps/myproject/clientlibs/clientlib-site/js/needle-engine.js:

  2. Add to your page template (HTL):

  3. For dynamic content, use Sling Models:

    Java Sling Model:

    HTL Template:


Approach 4: Experience Fragments

Best for: Reusable 3D content across multiple pages or channels (email, mobile app, etc.).

Experience Fragments let you create reusable Needle Engine content that can be shared across pages and exported to other channels.

Steps

  1. Create an Experience Fragment template with Needle Engine component

  2. Content authors can:

    • Create an Experience Fragment with 3D content

    • Configure the Needle Engine component once

    • Reuse across multiple pages

    • Export to Adobe Target for personalization

    • Use in email campaigns or mobile apps

  3. Reference the fragment on pages:

:::tip Multi-Channel Content Experience Fragments are especially powerful when you need the same 3D content across web, mobile apps, and email campaigns. Configure once, use everywhere. :::


Advanced Integration: Communication Between AEM and Needle

For advanced use cases where AEM content needs to interact with Needle Engine (e.g., clicking an AEM button triggers an animation in the 3D scene).

Example: Triggering 3D Animations from AEM

AEM Component JavaScript:

Needle Engine Component (TypeScript):


Asset Management Considerations

Where to Host Needle Engine Projects

Option
Best For
Pros
Cons

Needle Cloud

Quick iteration, dev/staging

Fast deployment, preview sharing

May want custom domain for production

AEM DAM

Enterprise compliance, single platform

Integrated with AEM, compliance

Larger asset sizes, may need CDN

Separate CDN

Performance-critical apps

Fast global delivery, cache control

Additional infrastructure

AEM Publish

Simple setups

No extra infrastructure

Not optimized for 3D assets

  1. Development: Host on Needle Cloud for rapid iteration

  2. Staging: Host on AEM staging environment or dedicated CDN

  3. Production: Host on CDN (CloudFront, Akamai, etc.) with AEM URLs stored in component properties


Content Author Workflow

A typical workflow for content authors:

  1. Receive 3D content from design/development team

    • Deployed to Needle Cloud or CDN

    • Provided with URL

  2. Add to AEM page

    • Drag Needle Engine component onto page

    • Configure URL and options in dialog

    • Preview in edit mode

  3. Adjust properties as needed

    • Height, background color, AR features

    • Integration mode (iframe vs direct)

  4. Publish the page

:::tip For Content Authors The Needle Engine component works like any other AEM component. Just paste the URL of your 3D experience and configure the display options. No coding required! :::


Performance Best Practices

  1. Use CDN for assets

    • Host .glb files and textures on a CDN

    • Leverage AEM Dispatcher caching for static resources

  2. Lazy loading

    • Load Needle Engine only when the component is visible

    • Use Intersection Observer API

  3. Optimize 3D content

  4. AEM Dispatcher configuration


Security Considerations

  1. Content Security Policy (CSP)

    Add Needle Engine domains to your AEM CSP:

  2. Permissions for XR Features

    Ensure your AEM pages allow necessary permissions:

  3. Asset Access Control

    • Use AEM's built-in authentication if hosting on AEM

    • Consider signed URLs for sensitive 3D content


Troubleshooting

Component not appearing in edit mode

Check:

  • Component is added to page template policy

  • Component group is correct

  • Author has necessary permissions

3D content not loading

Check:

  • Project URL is accessible (open in browser)

  • CORS headers are set correctly on hosting server

  • CSP allows loading from external domains

  • Browser console for errors

Performance issues

Check:


Example: Complete Integration

Here's a complete example combining multiple approaches:


Next Steps

Learn More:

Get Help:

:::tip Need Help? Integrating with enterprise CMS platforms can be complex. Reach out on our forumarrow-up-right or Discordarrow-up-right for specific AEM integration questions. :::

Last updated