Documentation
    Preparing search index...

    Interface RestateEndpointBase<E>

    interface RestateEndpointBase<E> {
        bind<P extends string, M>(
            service:
                | ServiceDefinition<P, M>
                | VirtualObjectDefinition<P, M>
                | WorkflowDefinition<P, M>,
        ): E;
        setLogger(logger: LoggerTransport): E;
        withIdentityV1(...keys: string[]): E;
    }

    Type Parameters

    • E

    Hierarchy (View Summary)

    Index

    Methods

    • Replace the default console-based LoggerTransport

      Parameters

      Returns E

      Using console:

      restate.setLogger((meta, message, ...o) => {console.log(`${meta.level}: `, message, ...o)})
      

      Using winston:

      const logger = createLogger({ ... })
      restate.setLogger((meta, message, ...o) => {logger.log(meta.level, {invocationId: meta.context?.invocationId}, [message, ...o].join(' '))})

      Using pino:

      const logger = pino()
      restate.setLogger((meta, message, ...o) => {logger[meta.level]({invocationId: meta.context?.invocationId}, [message, ...o].join(' '))})
    • Provide a list of v1 request identity public keys eg publickeyv1_2G8dCQhArfvGpzPw5Vx2ALciR4xCLHfS5YaT93XjNxX9 to validate incoming requests against, limiting requests to Restate clusters with the corresponding private keys. This public key format is logged by the Restate process at startup if a request identity private key is provided.

      If this function is called, all incoming requests irrelevant of endpoint type will be expected to have x-restate-signature-scheme: v1 and x-restate-jwt-v1: <valid jwt signed with one of these keys>. If not called,

      Parameters

      • ...keys: string[]

      Returns E