External blob storage services to use in the Server Framework and TypeScript runtime

Hey guys and gals!

Our game is based on Images, video and text, alot of those videos and text we would like to store somewhere else then in the DB, as you can imagine. But getting it working with a typescript module seems to be more challanging then expected because of the compiling with rollup and external npm modules.

How have others made this work? other solutions? othere storage options?


@linjoe It would help to know exactly what challenges you’ve faced using the TypeScript runtime, it’s possible what you’re trying to do will work but I can’t say without seeing error output for example.

That aside a common pattern is to use Nakama’s Storage API as a “registry” of assets, but store the assets themselves in something like AWS S3 or GCP Cloud Storage. Uploading can be done via Nakama (the server receives an RPC request to upload, validates it, and writes to both the storage bucket and the asset registry), and for downloading you can expose Nakama RPC functions that generate limited-scope download URLs which clients can use directly.

Would this cover the use case you have in mind?

Thank you for you clear awnser Zyro!

This is indeed exactly what I am trying to build. The thing that I cannot seem to get working is compiling my typescript in rollup, when i combine the npm module of aws or GCP.
I’ve tried with the tutorial from you website, and also started working with this boilertemplate:

but nothing seems to work…

while compiling, simply adding the ‘@google-cloud/storage’ module, and no other code yet:

(!) Circular dependencies
node_modules/google-auth-library/build/src/crypto/crypto.js -> node_modules/google-auth-library/build/src/crypto/browser/crypto.js -> node_modules/google-auth-library/build/src/crypto/crypto.js
node_modules/google-auth-library/build/src/crypto/crypto.js -> node_modules/google-auth-library/build/src/crypto/browser/crypto.js -> /home/linjoe/nakomo_test/nakama-rollup-ts/node_modules/google-auth-library/build/src/crypto/crypto.js?commonjs-proxy -> node_modules/google-auth-library/build/src/crypto/crypto.js
node_modules/readable-stream/lib/_stream_readable.js -> node_modules/readable-stream/lib/_stream_duplex.js -> node_modules/readable-stream/lib/_stream_readable.js
...and 5 more
(!) Unresolved dependencies
fast-crc32c (imported by fast-crc32c?commonjs-external)
request (imported by request?commonjs-external)
worker_threads (imported by worker_threads?commonjs-external)

If by any chance you have already built this before, I would be very greatfull to read you code:)