Module app

Entrypoint for SDK that should be used within application bundle. It works well with server and client side rendering.

Client side

At client side your app receives instance of the IlcAppSdk via props that are passed to it's lifecycle functions (LifeCycles). So everything is pretty simple here :) Typings can be loaded in the following way:

Example

import IlcAppSdk from 'ilc-sdk/app';

Server side

Unfortunately during app's SSR we don't have ILC in place. So we need to use result of the processRequest (which implements AppSdkAdapter) to receive all the necessary data for IlcAppSdk initialization.

Example

const IlcSdk = require('ilc-sdk').default;
const IlcAppSdk = require('ilc-sdk/app').default;

const ReactDOMServer = require('react-dom/server');
const {default: App} = require('./build/server');

server.get('*', (req, res) => {
const ilcReqData = ilcSdk.processRequest(req);
const appSdk = new IlcAppSdk(ilcReqData);

const html = ReactDOMServer.renderToString(App(appSdk));

res.send(html);
});

Index

Modules

Enumerations

Classes

Interfaces

Type Aliases

Functions

Generated using TypeDoc