Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): add self-hosted Rive module wrapper

Richie McIlroyfdbc33a72b1b
diff --git a/apps/web/lib/rive.ts b/apps/web/lib/rive.ts
new file mode 100644
index 000000000..6b440eabc
--- /dev/null
+++ b/apps/web/lib/rive.ts
@@ -0,0 +1,11 @@
+"use client";
+
+import { RuntimeLoader } from "@rive-app/react-canvas";
+
+// Self-host the Rive WASM. By default @rive-app/canvas fetches its runtime from
+// unpkg.com on first use, which adds a third-party origin (extra DNS/TLS) to the
+// critical path. The file under /public/rive must stay in sync with the
+// @rive-app/canvas version that @rive-app/react-canvas resolves to.
+RuntimeLoader.setWasmUrl("/rive/rive.wasm");
+
+export * from "@rive-app/react-canvas";