RenderHandlerOptions
@ebitex/content-sdk/render — serve ebitex’s render protocol from your own app, or reuse the default email renderer.
A sender of messages (ebitex Audience) asks your app to turn one of your pages into a message. This entry has the
handler that answers it and a default renderer for sites that have no email layout of their own. Nothing here needs React
or a DOM: it runs anywhere with the standard Request, Response and Web Crypto.
Properties
Section titled “Properties”
optionalnow?: () =>number
Seconds since the epoch. Defaults to the clock; a parameter so a test need not wait.
Returns
Section titled “Returns”number
render
Section titled “render”render: (
request) =>RenderResult|Promise<RenderResult>
Turns a request into a message. Throw RenderNotFoundError when the page is not published; anything else answers 500.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”RenderResult | Promise<RenderResult>
secretFor
Section titled “secretFor”secretFor: (
channelId) =>string|Promise<string|undefined> |undefined
The secret a connection signs its requests with, looked up by the request’s channelId. Return undefined for a connection you do
not know and the request is refused. It is read before the signature is checked, so treat the id as untrusted.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Returns
Section titled “Returns”string | Promise<string | undefined> | undefined
toleranceSeconds?
Section titled “toleranceSeconds?”
optionaltoleranceSeconds?:number
How far a request’s timestamp may be from now, in seconds. Defaults to five minutes.