Examples
Warning
Unless you hold the copyright to the model and all of its assets, do not load the actual file directly from a public URL or from files bundled with your app. Use one of the approaches below instead.
vue-vrm only accepts ArrayBuffers (see Why ArrayBuffer only). These examples show how to deliver model files from a server so that they never appear as public URLs in your code. Both run on Cloudflare Workers.
In both cases, the app side is the same: fetch the bytes and pass them to model-data.
The complete implementation is available in logue/v.logue.dev:
functions/api/assets/[[path]].ts— serving VRM files from R2functions/api/vrm/[avatar_id].ts— loading models from VRoid Hub