{"enrichment":{"faq":[{"a":"pixijs-environments enables PixiJS to run in non-browser contexts like Web Workers, Node.js, and SSR by using environment-specific adapters. Before initializing your app, call `DOMAdapter.set()` with the appropriate adapter\u2014BrowserAdapter for standard DOM, WebWorkerAdapter for OffscreenCanvas in workers, or a custom adapter for headless/testing. This decouples PixiJS from browser APIs and lets you render in any JavaScript runtime.","q":"How do you run PixiJS outside the browser?"},{"a":"pixijs-environments provides DOMAdapter as the core abstraction for environment-specific behavior. Before calling `app.init()`, use `DOMAdapter.set(adapter)` to register your chosen adapter\u2014built-in options include BrowserAdapter, WebWorkerAdapter, and custom implementations. The adapter handles DOM queries, canvas creation, and event binding, allowing PixiJS to work seamlessly across browsers, workers, and headless environments.","q":"What is DOMAdapter and how do you set it up?"},{"a":"pixijs-environments supports CSP-compliant setup by avoiding unsafe-eval during initialization. Configure your adapter before app creation and ensure your build includes pre-compiled shaders or CSP-safe shader compilation. The adapter pattern isolates environment-specific code, letting you enforce strict CSP headers without compromising PixiJS functionality in production deployments.","q":"How can PixiJS work with strict Content Security Policy without unsafe-eval?"},{"a":"pixijs-environments includes WebWorkerAdapter for OffscreenCanvas rendering in Web Workers. In your worker thread, import the adapter, call `DOMAdapter.set(new WebWorkerAdapter())` before app initialization, then pass an OffscreenCanvas to your app. This enables offscreen rendering with canvas transfer back to the main thread, improving performance by moving graphics work off the UI thread.","q":"How to use PixiJS in web workers with OffscreenCanvas?"},{"a":"pixijs-environments replaces the v7 `settings.ADAPTER` pattern with explicit `DOMAdapter.set()` calls. Instead of globally configuring adapters via settings, v8 requires you to set the adapter before app initialization. This provides clearer control flow and supports multiple adapter instances, making environment-specific configuration more explicit and testable.","q":"What changed in PixiJS v8 adapter configuration?"},{"a":"pixijs-environments defines a standard Adapter interface for custom implementations. Implement methods for canvas creation, DOM queries, and event handling tailored to your testing framework. Pass your custom adapter to `DOMAdapter.set()` before app init. This approach lets you mock rendering, stub events, and run PixiJS in CI/CD pipelines without a real browser or GPU.","q":"How do you create a custom adapter for headless testing?"}],"shadow_tags":["multi-environment-runtime","dom-abstraction-layer","worker-thread-graphics","csp-policy-compliant","headless-rendering","server-side-rendering","adapter-pattern","offscreen-canvas","eval-free-polyfill"],"summary_rewrite":"This skill equips agents to deploy PixiJS v8 rendering outside traditional browser contexts\u2014including Web Workers, Node.js servers, and server-side rendering pipelines. It covers environment detection, fallback strategies, and configuration patterns needed to initialize and manage the 2D graphics engine across diverse runtime targets."},"files":[{"bytes":8496,"path":"skills/pixijs-environments/SKILL.md","sha256":"5cfab873cbf8c68ce3e010bc96262d88e4e924ae6fa8345c614ae8256f22360e","url":"https://skillfed.io/files/pixijs/pixijs-skills/pixijs-environments/c59612f5/SKILL.md"}],"id":"pixijs/pixijs-skills/pixijs-environments","links":{"html":"https://skillfed.io/pixijs/pixijs-skills/pixijs-environments","md":"https://skillfed.io/pixijs/pixijs-skills/pixijs-environments.md","repo":"https://github.com/pixijs/pixijs-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":16,"language":null,"last_updated":"2026-06-04","license":"MIT","name":"pixijs-environments","publisher":"pixijs","stars":293},"relations":{"similar":[{"id":"pixijs/pixijs-skills/pixijs-core-concepts"},{"id":"pixijs/pixijs-skills/pixijs-migration-v8"},{"id":"pixijs/pixijs-skills/pixijs"},{"id":"pixijs/pixijs-skills/pixijs-application"},{"id":"pixijs/pixijs-skills/pixijs-accessibility"},{"id":"pixijs/pixijs-skills/pixijs-performance"},{"id":"pixijs/pixijs-skills/pixijs-custom-rendering"},{"id":"pixijs/pixijs-skills/pixijs-scene-dom-container"},{"id":"pixijs/pixijs-skills/pixijs-blend-modes"},{"id":"pixijs/pixijs-skills/pixijs-html-source"}]},"slug":{"owner":"pixijs","repo":"pixijs-skills","skill":"pixijs-environments"},"version":"c59612f5"}
