spanDEX Cloud
spanDEX cloud is a managed service which adheres to the same principles as proxy mode, but is hosted and maintained by the spanDEX team. It is intended for simple setup, testing, agents, and small deployments. It can easily be switched to and from proxy mode, so it's a great way to get started with spanDEX without needing to set up your own infrastructure.
Setup
import { createConfig, spandexCloud } from "@spandex/core";
export const config = createConfig({
proxy: spandexCloud({
apiKey: process.env.SPANDEX_CLOUD_API_KEY || 'demo',
}),
});Note: The demo API key is a fake key, but still works. It is intended for testing and development. If you wish to use spanDEX cloud in production, let us know so we can set you up with a configured key.
In React:
import { SpandexProvider } from "@spandex/react";
<SpandexProvider config={config}>{children}</SpandexProvider>;How It Relates to Proxy Mode
- Uses the same
AggregatorProxyand wire protocol as Proxy Mode. - Runs on a managed deployment (
https://edge.spandex.sh/api/v1) with API key auth. - Streams both raw quotes and simulated quotes from the managed service.
If you need fully custom endpoints or custom infra, use
proxy({ pathOrUrl, delegatedActions: ["prepareSimulatedQuotes"] }) instead.