Skip to content

fozzylyon/xpr-hapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xpr-hapi

Install

npm install xpr-hapi

Options

Can be configured with options following this schema:

{
  timeout: 10000,
  featureUrl: 'https://example.com/',
  devKey: 'xxxxxxx',
  cookieName: 'xpr.config'
  experiments: [
    {
      name: 'featureFlagTest',
      default: true,
      description: 'This is a test feature flag.',
    },
  ],
  cronTime: '* * * * *',
  callback: (err, settings) => {
    // ...
  },
  announce: true,
  reference: 'local',
}

Options specific to this plugin:

  • crontTime: Used to call featureClient.cron(...);. Defaults off
  • announce: Used to determine if experiments are announced via featureClient.announce(). Defaults off
  • callback: The callback passed cron() and announce()

Example

Below is an example plugin loading script:

'use strict';

const xprHapi = require('xpr-hapi');

module.exports = {
  register: xprHapi,

  options: {
    featureUrl: 'https://example.com/',
    devKey: '1z-2a-3y-4b-5x-6c',
    experiments: [
      {
        name: 'featureFlagTest',
        default: true,
        description: 'This is a test feature flag.',
      },
    ],
    cronTime: '* * * * *',
    announce: false,
    reference: 'int',
  },
};

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published