rudra.js

Recommendation blocks written by a model, rendered on the server from your catalog.

Without a model

Leave the provider out, or pass null, and nothing calls a model and nothing gets billed.

const generator = createComponentGenerator({ provider: null });
const spec = await generator.generate(input);

This is a supported setting, not a stub. It is the control arm of the benchmark, and it is the right one until you have settled on a provider. generate returns a promise either way, so your code keeps its shape when you add one.

What you get

The deterministic component emits exactly one grid block, with a headline from a fixed set of four — or no blocks at all when there is nothing left to show. That happens when no candidate is in stock, and equally when every one of them is ruled out for this shopper.

Every other block kind in the vocabulary — hero, carousel, banner, copy, bundle — only ever comes from a model. So if you are wiring up bundles and none appear, that is why. It is not your catalog.

Rendering a spec you wrote yourself

Pass createFixedSpecProvider(spec) and it answers every request with that spec. That is how the library’s own tests exercise the blocks the deterministic component never emits.

import { createFixedSpecProvider } from '@rudra-js/core';

const generator = createComponentGenerator({
  provider: createFixedSpecProvider(mySpec),
});

Further reading