An implementation of the Luvio NetworkAdapter that allows for multiple NetworkAdapters in the same environment.
npm i @luvio/network-adapter-composable
import { buildComposableNetworkAdapter } from '@luvio/network-adapter-composable';
import { composedJwtNetworkAdapter } from '@luvio/network-adapter-jwt';
import { fetchNetworkAdapter } from '@luvio/network-adapter-fetch';
const networkAdapter = buildComposableNetworkAdapter([
composedJwtNetworkAdapter, // Ex: handle ResourceRequests that needs JWT authentication, leveraging on the baseUri
{
shouldHandleRequest: () => true, // default network adapter
adapter: fetchNetworkAdapter,
},
]);
const luvio = new Luvio(new Environment(new InMemoryStore(), networkAdapter));