Skip to main content

Getting Started

Living Apps are built using common web technologies. Developers just need to design their apps for a 1920x1080 pixels screen and make use of the Living Apps Javascript SDK to get superpowers:

Installation

Add to your HTML index:

<script src="https://globalmakermedia.blob.core.windows.net/core/sdk/index.js"></script>

<link
rel="stylesheet"
href="https://globalmakermedia.blob.core.windows.net/core/sdk/index.css"
/>

By importing the SDK's index.js we are including the key laSdk into the global window object.

window object screenshotwindow object screenshot


Now, the very first rule for the LivingApps SDK is that you need to wait for window.laSdk.ready() promise to resolve

danger

Don't run your App logic until laSdk is ready:

window.laSdk
.ready()
.then(() => {
// your logic here
})
.catch((err) => {
// error
});

Hello world

Most Basic React LA:

function App() {
return <h1>Hello World</h1>
}

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);

window.laSdk
.ready()
.then(() => {
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);

window.addEventListener('laclose', () => {
root.unmount();
});
})
.catch((err) => {
// error
});

Renders the simplest 1920x1080 Living APP:

Hello World React App

Inspecting it, there will be no surprises:

<html>
<head>
<script src="https://...sdk/index.js"></script>
<link rel="stylesheet" href="https://...sdk/index.css" />
<link rel="stylesheet" href="/src/index.css" />
...
</head>
<body style=" ... ">
<div #root>
<h1>Hello Wold</h1>
</div>
<script src="/src/main.tsx"></script>
</body>
</html>

Using typescript

We publish @telefonica/living-apps-core-web-types on NPM containing only type definitions.

npm install --save-dev @telefonica/living-apps-core-web-types
note

run npm update @telefonica/living-apps-core-web-types to get an updated type definitions if needed.

Enabling TypeScript in your LA can enhance code quality and provide better static typing:

typescript error screenshottypescript error screenshot

Next Steps

info

Note that set top box browsers have limited CPU and Memory capabilities. Always optimize your app images, css & javascript animations and test them on real STB frequently.

Contact the Living Apps Core Team for extra support.