You could do something like the following for example where you have one Durable Object class in you

You could do something like the following for example where you have one Durable Object class in your wrangler binding (e.g. MY_DURABLE_OBJECT) but when you do the
idFromName
you can pass something specific to the tenant you want. Each unique
id
creates its own isolated DO with its own SQLite storage.
let id = env.MY_DURABLE_OBJECT.idFromName('user_1');
let stub = env.MY_DURABLE_OBJECT.get(id);
return stub.fetch(request);

So above I could change
user_1
to be any of my users and I'd be routed to their specific DO instance.
Was this page helpful?