<commit_before>[![Build Status](https://travis-ci.org/bucharest-gold/unifiedpush-admin-client.svg?branch=master)](https://travis-ci.org/bucharest-gold/unifiedpush-admin-client) [![Coverage Status](https://coveralls.io/repos/github/bucharest-gold/unifiedpush-admin-client/badge.svg?branch=master)](https://coveralls.io/github/bucharest-gold/unifiedpush-admin-client?branch=master)

## Unified Push Admin Client

A client for connecting to the AeroGear UnifiedPush servers admin REST API - https://aerogear.org/docs/specs/aerogear-unifiedpush-rest/#home

## API Documentation

http://bucharest-gold.github.io/unifiedpush-admin-client/

### Server Setup

At the moment, you must enable "Direct Access Grants" on the UnifiedPush Server for this to work
<commit_msg>add example to the readme<commit_after>[![Build Status](https://travis-ci.org/bucharest-gold/unifiedpush-admin-client.svg?branch=master)](https://travis-ci.org/bucharest-gold/unifiedpush-admin-client) [![Coverage Status](https://coveralls.io/repos/github/bucharest-gold/unifiedpush-admin-client/badge.svg?branch=master)](https://coveralls.io/github/bucharest-gold/unifiedpush-admin-client?branch=master)

## Unified Push Admin Client

A client for connecting to the AeroGear UnifiedPush servers admin REST API - https://aerogear.org/docs/specs/aerogear-unifiedpush-rest/#home

## API Documentation

http://bucharest-gold.github.io/unifiedpush-admin-client/


## Example

    'use strict';

    let adminClient = require('unifiedpush-admin-client');

    let baseUrl = 'http://127.0.0.1:8080/ag-push';

    let settings = {
        username: 'admin',
        password: '<PASSWORD>'
    };

    adminClient(baseUrl, settings)
      .then((client) => {
        return client.applications.find()
          .then((applications) => {
            console.log('applications', applications);
          });
      })
      .catch((err) => {
        console.log('Error', err);
      });

### Server Setup

At the moment, you must enable "Direct Access Grants" on the UnifiedPush Server for this to work

{'fraction_non_alphanumeric': 0.14376218323586745, 'fraction_numerical': 0.004873294346978557, 'mean_word_length': 4.069135802469136, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4380629', 'n_tokens_mistral': 660, 'n_tokens_neox': 648, 'n_words': 116}