To enable support for Apigee-related functions in your HTML, you'll
need to include
apigee.js
in your app. To do this, add the following to the
head
block of your HTML:
<script type="text/javascript" src="path/to/js/sdk/apigee.js"></script>
Apigee.Client initializes the App Services SDK, and gives you access to all of the App Services SDK methods.
You will need to pass a JSON object with the UUID or name for your App Services organization and application when you instantiate it.
//Apigee account credentials, available in the App Services admin portal var client_creds = { orgName:'{{currentOrg}}', appName:'{{currentApp}}' } //Initializes the SDK. Also instantiates Apigee.MonitoringClient var dataClient = new Apigee.Client(client_creds);
Once initialized, App Services will also automatically instantiate
Apigee.MonitoringClient
and begin logging usage, crash and error metrics for your app.
To verify that the SDK has been properly initialized, run your app, then go to 'Monitoring' > 'App Usage' in the App Services admin portal to verify that data is being sent.
Use
dataClient
or
dataClient.monitor
to call SDK methods:
dataClient
: Used to access the data
methods of the App Services SDK, including those for push
notifications, data store, and geolocation.dataClient.monitor
: Used to access the app
configuration and monitoring methods of the App Services SDK,
including advanced logging, and A/B testing.With App Services you can quickly add valuable features to your mobile or web app, including push notifications, a custom data store, geolocation and more. Check out these links to get started with a few of our most popular features:
The SDK includes samples that illustrate Apigee features. To look at them, open the .xcodeproj file for each in Xcode. You'll find the samples in the following location in your SDK download:
apigee-javascript-sdk-master ... /samples
The samples include the following:
Sample | Description |
---|---|
booksSample.html | An app for storing a list of books that shows Apigee database operations such as reading, creating, and deleting. |
messagee | An app for sending and receiving messages that shows Apigee database operations (reading, creating). |
monitoringSample.html | Shows basic configuration and initialization of the HTML5 app monitoring functionality. Works in browser, PhoneGap, Appcelerator, and Trigger.io. |
readmeSample.html | A simple app for reading data from an Apigee database. |