Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@keg-hub/keg-core

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keg-hub/keg-core

A framework for developing cross-platform react apps, that is preconfigured to target both web, desktop, and mobile architectures.

  • 10.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
3
Weekly downloads
 
Created
Source

Keg Core

Overview

The keg is a platform for developing cross-platform react apps. It comes preconfigured to target both web and mobile, and it contains a collection of utilities for simplifying development, including:

  • built-in routing and navigation
  • a reducer based on the relational data model
  • dynamic theming via re-theme
  • cross platform persistent storage

Tap usage

  • To start, first setup the keg-cli
  • Next, use the cli to generate a tap: keg gn tap
  • cd into your tap's directory, then run yarn setup
  • The tap you generated will have installed keg-core as a dependency
  • Read more about tap-development here

Defining Environment Variables

  • Within your tap's config file (e.g. tap.js, tap.json), you can define an envs property in the keg object like this:
module.exports = {
  ...,
  keg: {
    ...
    envs: {
      'process.env.FOO': 'bar',
      SOME_API_KEY: getAPIKey()
      'process.env.TAP_LICENSE': 'tap.package.license'
    }
  }
}

And these will be replaced in your code, so that you can use them like this:

const myFunction () {
  makeAPICall(SOME_API_KEY)
  console.log('Foo', process.env.FOO)
  console.log('This tap uses the license', process.env.TAP_LICENSE)
}
  • you can define dynamic envs that pull data from a package.json or an app config by using the form: <tap|core>.<package|config>.<some_property>
    • so the tap.package.license will evaluate to the value of the license property in your tap's package.json
  • every env is automatically stringified
Running with webpack / expo
  • These envs are automatically replaced for you at build time
Running with other build tools
  • If you use a different bundler, like rollup, you can still use these envs by importing the getKegEnvs function from keg-core/core/scripts/js/getKegEnvs
  • then, just use them into your tool's replacement plugin

Architecture

Store

FAQs

Package last updated on 27 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc