Skip to main content
When a script needs a library — GSAP, Swiper, a date picker — add it as a dependency instead of pasting another embed into Webflow. Cairn loads dependencies before your script runs.

Adding a library

Open Dependencies from the script editor and paste either a full <script> tag or a bare CDN URL. Cairn extracts the URL and asks for:
  • Name — a label, just for you (e.g. GSAP).
  • Global — optional: the global variable the library exposes (e.g. gsap). Recording it documents what your script can rely on once the dependency has loaded.

The CDN allowlist

Dependency URLs must be https and hosted on a trusted CDN. Cairn currently allows (including subdomains):
HostTypical use
jsdelivr.netnpm & GitHub packages
unpkg.comnpm packages
esm.shnpm packages as ES modules
cdnjs.cloudflare.compopular libraries
skypack.devnpm packages as ES modules
jspm.ionpm packages as ES modules
code.jquery.comjQuery
fonts.googleapis.com / fonts.gstatic.comGoogle Fonts
ajax.googleapis.comGoogle-hosted libraries
Dependencies ship to every visitor of your site on every matching page load, so Cairn restricts them to established CDNs rather than arbitrary origins. URLs outside the allowlist are rejected when you save.
Pin dependency versions in the URL (/gsap@3.12.5/) rather than using @latest or an unversioned path. Unpinned URLs can change behavior on your live site without any publish from you.

Imports inside your code

The allowlist applies to the structured dependency list. import statements inside your own script content are not blocked — it’s your code on your site — but the editor warns when a runtime import is untrusted (host not on the allowlist) or unpinned (no version). See ES modules.