jamplay-common
TypeScript icon, indicating that this package has built-in type declarations

4.3.0 • Public • Published

Jamplay common module

This package include reuse module in jamplay web project

Config

There are 3 config type in Jamplay plattform

  1. Server Runtime Config (confident)
  2. Public Runtime Config (public, permanently config string)
  3. Remote Runtime Config (public, dynamtic config string)

Remote config setup

There are some serveral step to setup Remote Config

Requirement

  • NAP_URL: because main Content data is NAP remote config need graphql endpoint to resolve it
  1. In _document.js: get config from remote and merge with __NEXT_DATA__
  import getConfig from 'jamplay-common/remote-config'
 
  .... in Document
  public static getInitialProps(ctx) {
    return {
      remoteConfig: getConfig().remoteRuntimeConfig
    }
  }
 
 
  constructor(props) {
    super(props)
    props.__NEXT_DATA__.remoteRuntimeConfig = props.remoteConfig
  }
 

Or you can use jamplay-common/client/_document as your _document class

  1. initial RemoteConfig singleton server
  • when your server start, init your server singleton config by call init
 
  await init(config.NAP_GRAPHQL_URI)
 

Readme

Keywords

none

Package Sidebar

Install

npm i jamplay-common

Weekly Downloads

1

Version

4.3.0

License

MIT

Unpacked Size

1.63 MB

Total Files

175

Last publish

Collaborators

  • devdigithun
  • rungsikorn