If you haven’t already, and you’re developing on iOS, visit the Apple Health docs and follow the “Enable HealthKit” section to configure HealthKit.


cordova plugin add https://github.com/metriport/cordova-sdk

You’ll need to ensure that the MetriportSDK pod is installed as well.

cd platforms/ios
pod install

If you are using Objective-C for your AppDelegate file you will need to set it up as follows:

#import "AppDelegate.h"
#import "MetriportConfiguration.h" // add this line

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   [MetriportConfiguration checkBackgroundUpdates]; // add this line

   // your code

If you are using Swift for your AppDelegate file you will need to set it up as follows:

import Foundation
import UIKit
import MetriportSDK // add this line
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var bridge: RCTBridge!
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    MetriportClient.checkBackgroundUpdates() // add this line

    // your code


To use our SDK, go to your index.html and add:

  <button id="show-widget">Open widget</button>

Then, in your js file add:

document.getElementById("show").addEventListener("click", () =>
    clientApiKey: "CLIENT_API_KEY",
    token: "CONNECT_TOKEN",

Ensure you use your Client Key here, and not your Secret Key. You can read more about the differences between the two in our API Keys guide.

As per the guide, we recommend to store your Client Key in environment secrets, and not commit it in plain text to your repository.

As per the Quickstart guide, you’ll need to generate a token on your server before opening the Connect Widget. You can read more about this here.

Apple Health

For details about receiving Apple Health data via webhooks, see the guide here.