Microsoft Azure SDK for Node.js - NotificationHubs Management
This project provides a Node.js package that makes it easy to manage Microsoft Azure NotificationHubs Resources.Right now it supports:
- Node.js version: 6.x.x or higher
- API Version: 2016-03-01
How to Install
npm install azure-arm-notificationhubs
How to Use
Authentication, client creation and listing notificationHubs associated with a namespace in a resource group as an example
var msRestAzure = ;var notificationHubsClient = ; // Interactive Login// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, // the user will get a DeviceTokenCredentials object.msRestAzure;
#### Managing a Namespace
var groupName = 'myResourceGroup';var namespaceName = 'myNamespace';var namespaceLocation = "South Central US"//Create a Namespace var createNamespaceParameters = location: namespaceLocation tags: tag1: 'value1' tag2: 'value2' ; console;clientnamespaces; //Get properties of an active Namespace console;clientnamespaces; //list all Namespaces within a resource group console;clientnamespaces; //list all Namespaces within your subscription console;clientnamespaces; //Create Namespace authorization rule var authRuleParameter = location: namespaceLocation name: authorizationRuleName rights: 'Listen' 'Send'; clientnamespaces; //show primary and secondary keys of the Namespace console;clientnamespaces; //regenerate keys of the cache regenerateKeyParameter = policyKey: 'primary KEY'; console;clientnamespaces;
Managing a Namespace and NotificationHubs
var createNotificationHubParameters = location: namespaceLocation wnsCredential: packageSid: 'ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699' secretKey: 'w7TBprR-THIS-IS-DUMMY-KEYAzSYFhp' windowsLiveEndpoint: 'http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf' ; //Create a NotificationHub console; clientnotificationHubs; //Get all NotificationHubsconsole;clientnotificationHubs; //Get NotificationHub PNS credentialsconsole;clientnotificationHubs;