# Approved libraries

A template's own code always stays inline. The one exception is an approved library: a third party JavaScript build that Rafflex staff have vetted, identified by the SHA-256 of its exact bytes, and hosted once at a shared, versioned URL for every product that uses it. This page is generated from the same registry the checker reads, so it lists exactly the builds a template may load today.

## Rules

- Load only a build listed under Approved builds, because the checker refuses any other build.
- Never write the shared URL by hand, never import a bare specifier such as "three" or "three/addons/...", never add an import map, and never use dynamic import(). The checker refuses all of them.
- A library never counts toward the product's storage.

## How to reference a library

1. Add the build to the product's media library. A connected AI calls attach_approved_library with the library name (and optionally the version). In the browser, the creator opens the studio's Media panel, presses Add approved library, and picks the build. Uploading a .js file also works, but only when its bytes are identical to a build listed below.
2. Reference it only through the files map, by the tag the media library shows (the library name by default). In a module script: `<script type="module">import * as THREE from "{{ files['three'] }}";</script>`. As a classic script: `<script src="{{ files['tag'] }}"></script>`.

When the creator does not name a version, leave the version out: attach_approved_library then uses the newest approved build. When the template already uses a build, keep its version unless the creator asks to upgrade, because a new version can change the library's behaviour.

The media guide covers the rest of the media library: https://marketplace.rafflex.io/docs/how-to-create/media.md

## Approved builds

### three 0.186.1

- Contents: core, GLTFLoader, OrbitControls
- Default tag: three (reference it as `{{ files['three'] }}`)
- Shared URL: https://marketplace.rafflex.io/media/libraries/three/0.186.1/three-0.186.1.module.js
- SHA-256: `dd862d9ab07789cc674846a67a0556f255b15a5144235e366350b049bec13ab3`
- Size: 784 KB
- Licence: MIT
- Approved: 3 October 2026

Licence notice (it also stays at the top of the build file):

```text
The MIT License

Copyright © 2010-2026 three.js authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```

## Requesting another library

When the idea needs a library that is not listed, tell the creator they can email support@rafflex.io with the library, the exact version, the parts of it they need, and what they want to build with it. Staff vet the build before approving it: it must be a single self contained file with no imports of its own, under a licence that allows it to be served to every customer site. Once approved, it appears on this page and in the studio's Add approved library picker.

## Checks before you finish

- The library is in the product's media library, and the template references it only as `{{ files['tag'] }}`.
- The template check passes with no script issues.

The full documentation index is at https://marketplace.rafflex.io/llms.txt