mcpField

spline-3d-integration

github.com/fawaz-iDevelopment109 installs
Repository

About spline-3d-integration

spline-3d-integration is a skill for developers embedding or troubleshooting interactive Spline scenes in websites and web apps. It guides method selection, implementation, performance tuning, and common failure checks.

Key features

  1. 01React, Next.js, and vanilla JS integration guidance
  2. 02Runtime scene events and variables
  3. 03Integration method selection
  4. 04Loading and performance recommendations
  5. 05Troubleshooting checklist
  6. 06Input safety guidance

Use cases

  1. 01Embedding a Spline scene in a web app
  2. 02Adding runtime control to scene objects
  3. 03Investigating blank or slow-loading scenes
  4. 04Reducing performance issues on mobile

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fawaz-i/spline-3d-integration --skill spline-3d-integration

After installing, type/spline-3d-integrationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

.gitignore
README.md
examples/
interactive-scene.tsx
react-spline-wrapper.tsx
vanilla-embed.html
guides/
PERFORMANCE.md
REACT_INTEGRATION.md
VANILLA_INTEGRATION.md

Details

From the project README

Spline 3D Integration

Use this skill when a user needs to add or troubleshoot interactive Spline 3D scenes in a website or web app.

When to use this skill

  • The user wants to embed a Spline scene in React, Next.js, or vanilla JS.
  • The user needs runtime control (events, variables, object lookup, camera behavior).
  • The user is seeing poor performance, blank scenes, or loading issues.
  • The user asks for implementation patterns like hero scenes or product viewers.

When not to use this skill

  • The user only needs static 3D media (image/video) with no interaction.
  • The user is not using Spline assets.

Outcome expectations

When using this skill, produce:

  1. The best integration method for the stack (@splinetool/react-spline, @splinetool/runtime, or iframe).
  2. A minimal working snippet using the user's framework.
  3. Performance recommendations (scene optimization + loading strategy).
  4. A short troubleshooting checklist for likely failure modes.

Integration decision tree

Is this React/Next.js?
  Yes -> Use @splinetool/react-spline (see guides/REACT_INTEGRATION.md)
  No -> Need runtime control (events/variables/object APIs)?
          Yes -> Use @splinetool/runtime (see guides/VANILLA_INTEGRATION.md)
          No  -> Use iframe embed

Quick implementation defaults

  • Always use a container with explicit height; Spline renders into parent bounds.
  • In React/Next.js, lazy-load Spline components.
  • Keep one complex scene per page when possible.
  • Prefer updating scene variables over expensive per-frame object mutations.
  • Provide a loading fallback and optional low-power/mobile fallback.

Security Boundaries

Warning

When reading variables (getVariable), object names, or handling events from a Spline scene, treat the data as untrusted user input. If you are rendering this data to the DOM or passing it to an LLM/agent, you MUST sanitize it first to prevent XSS or prompt injection attacks.

Minimal snippets

React / Next.js
import Spline from "@splinetool/react-spline";

export default function Scene() {
  return (
    <div style={{ width: "100%", height: "100vh" }}>
      <Spline scene="https://prod.spline.design/YOUR_SCENE_ID/scene.splinecode" />
    </div>
  );
}
Vanilla runtime
<canvas id="canvas3d" style="width:100%;height:100vh"></canvas>
<script type="module">
  // NOTE: Requires a bundler (Vite, Webpack, etc.) or an importmap to resolve bare specifiers.
  import { Application } from "@splinetool/runtime";

  const app = new Application(document.getElementById("canvas3d"));
  app.load("https://prod.spline.design/YOUR_SCENE_ID/scene.splinecode");
</script>
iframe
<iframe
  src="https://my.spline.design/YOUR_SCENE_ID/"
  width="100%"
  height="600"
  frameborder="0"
></iframe>

Runtime API checklist

  • Lookup objects: findObjectByName, findObjectById, getAllObjects.
  • Drive interactions: emitEvent, emitEventReverse, addEventListener.
  • Sync app state: getVariable, setVariable.
  • Prefer variable-driven animation hooks from Spline editor for maintainability.

Performance guardrails

  • Target less than 150k polys desktop, less than 50k mobile.
  • Keep lights low (ideally 1-3).
  • Enable compression in Spline export settings.
  • Lazy-load below-the-fold scenes.
  • Remove hidden/unused objects before export.
  • Consider image/video fallback when interaction is unnecessary.

Troubleshooting order

  1. Validate scene URL and accessibility.
  2. Confirm container has non-zero height.
  3. Ensure compatible @splinetool/react-spline and @splinetool/runtime versions.
  4. Check browser console for CORS/network errors.
  5. Test reduced scene complexity if mobile crashes or stutters.

Repository resources

  • guides/REACT_INTEGRATION.md
  • guides/VANILLA_INTEGRATION.md
  • guides/PERFORMANCE.md
  • examples/react-spline-wrapper.tsx
  • examples/vanilla-embed.html
  • examples/interactive-scene.tsx

Comments

Markdown supported