Function raw

  • Sends a raw fetch request to an API. Useful to call API endpoints that have no dedicated Fdk method or function. The fetched URL is composed of:

    https://<subdomain>(.cachena).entrecode.de/<route>?<options>
    

    Type Parameters

    • T = any

    Parameters

    • config: {
          env?: string;
          route?: string;
          subdomain?: string;
          options?: Record<string, any>;
          token?: string;
          rawRes?: boolean;
      }
    • fetchOptions: {} = {}

    Returns Promise<T>

    const options = {
    size: 25,
    dataManagerID: 'x',
    modelID: 'y'
    };
    const list = await raw({
    env: "stage",
    options, // query options
    route: 'entries',
    subdomain: 'dm-history',
    rawRes: true // if true, no .json() is called on res
    });
    // https://dm-history.cachena.entrecode.de/entries?size=25&datamanagerID=x&modelID=y
    // checkout ec.editor4 for more examples