🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ng2-keepalive

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-keepalive

Microservice Keepalive Module

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

NG2 Keepalive

NG2 Keepalive is a keepalive module that allows sessions to be extended across multiple servers (useful for microservices without shared sessions)

Dependencies

  • @angular/common
  • @angular/core
  • @angular/http

Installation

npm install --save ng2-keepalive

Once installed you need to import our main module:

import {KeepaliveModule} from 'ng2-keepalive';

The only remaining part is to list the imported module in your application module, passing in a config to intialize the logger.

@NgModule({
  declarations: [AppComponent, ...],
  imports: [KeepaliveModule.forRoot({...}), ...],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Usage

To use NG2 Keepalive, you will need to add it to your an application html file

<ng2-keepalive></ng2-keepalive>

Config Options

  • activeInterval: {number} - (in seconds) the amount of time since a last action until the user is considered idle : default 15 seconds

  • idleInterval: {number} - (in seconds) the amount of time a user is idle before the user is warned : default 15 minutes

  • warnInterval: {number} - (in seconds) the amount of time a user is warned before the user session is expired : default 60 seconds

  • pingInterval: {number} - (in seconds) how often the server is pinged : default 15 seconds

  • idleOffset {number} - (in seconds) the offset time from your session, so that the client doesn't think the session is good when the server session expires : default 60 seconds

  • pingUrls {string[]} - array of urls to ping ?extend=true will be added if the user has been active : default '/ping'

  • numberOfRetries {number} - number of times failed pings should retry before erroring out

Keywords

angular2

FAQs

Package last updated on 06 Mar 2017

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