8.4.3 • Published 2 years ago

@huumun/lyra v8.4.3

Weekly downloads
37
License
MIT
Repository
-
Last release
2 years ago

Author: Sahil David, Margarida López | Date: August 17th, 2020 | Last updated: June 14th 2022

LYRA Integration

Overview

LYRA is a Content Management Solution which is one of the solutions as a part of huumun Platform Suite. LYRA provides variable yet flexible data structures which gives the unique edge and ability to store data/content suited to your application.

LYRA offers keys in the form of, brandKey and projectKey which are generated automatically during the setup. These keys are required to make a connection to LYRA Platform from an application.

For details about access keys please contact Margarida Lopez margarida.lopez@huumun.com or huumun Developers developers@huumun.com

Using the package

LYRA offers an npm package for Integrating Vue application with LYRA

Following are the steps to use LYRA client npm package:

To install package:

npm i @huumun/lyra

Once installed LYRA can be installed into Vue App.

You also need to create lyra.config.js file in your root folder of Vue App. This serves as configuration file for package

module.exports = {
	brandKey: 'brandKey from LYRA',
	projectKey: 'projectKey from LYRA',
	localisations: [
		{ localisation: 'localisation-code', default: 'boolean', newInstance: 'boolean' }
	]
};
import lyraConfig from './lyra.config';
import { vueLyra } from '@huumun/lyra';

Vue.use(vueLyra, lyraConfig);

The above install step will expose methods to Vue prototype which can be used to access the data required. Following are the methods exposed

Assets Methods

  • Vue.prototype.$lyra.asset(key: string): Returns asset value with key
  • Vue.prototype.$lyra.assetExist(key: string): Returns true/false if asset exist with key
  • Vue.prototype.$lyra.assetsAll(): Returns all the assets with key/value

Citations Methods

  • Vue.prototype.$lyra.citation(): Returns citation value with key
  • Vue.prototype.$lyra.citationExist(key: string): Returns true/false if citation exist with key
  • Vue.prototype.$lyra.citationsAll(): Returns all the citations with key/value
  • Vue.prototype.$lyra.citationsAll(type: string): Returns all the citations with citation type

App Manager Methods

  • Vue.prototype.$lyra.appManager(): Returns complete App Manager
  • Vue.prototype.$lyra.appManager(tierId: string): Return Tier specific data
  • Vue.prototype.$lyra.endpoints({ tierId: string }): Return endpoints data for specific tier
  • Vue.prototype.$lyra.endpoints({ tierId: string, endpointId: string }): Return endpoint data for specific tier and endpoint

The $lyra methods are asynchronous in nature and returns a promise, with the value required.

Download content locally

LYRA npm package also allows to download the data/content locally to the projects directory in the form of JSON file. There are two modes for using LYRA. Package offers npm scripts to achieve required implementation.

  • Live mode: Get content directly from LYRA CMS.
# Script: lyra-live
# Usage in Client App: 
npm explore @huumun/lyra -- npm run lyra-live
  • Production mode: Content is downloaded and saved locally in the JSON files. The methods then serve local JSON files as database. This steps needs to be included before the Vue build phase.
# Script: lyra-prod
# Usage in Client App: 
npm explore @huumun/lyra -- npm run lyra-prod

Arguments

These are the arguments you can pass to your node script to configure your LYRA setup.

You should follow key=value syntax.

KeyModeValueDefault valueDescription
modeproduction, liveproductionDefines the LYRA content mode: live for live connection, production to download content locally.
localisationString-Defines the localisation it should get/download the content from.
statusproductionStringIf specified, will only download endpoints from specified tier (and its corresponding child tiers) and value. Usage status:{{tierId}}:{{endpoint status meta value}}. As an example, having a Studies tier with endpoints marked with status as live, we will use status=studies:live
8.4.1

2 years ago

8.4.0

2 years ago

8.4.3

2 years ago

8.4.2

2 years ago

8.3.0

3 years ago

8.2.0

3 years ago

8.1.0

3 years ago

8.1.2

3 years ago

8.1.1

3 years ago

8.0.0

3 years ago

7.0.0

3 years ago

4.0.0

4 years ago

5.0.0

4 years ago

6.0.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago