Provider SDK (v1.1)

Use window.nuwe to talk to the Nuwe app. Never call iOS WebKit handlers directly.

Where to get nuwe.js

The SDK is a single JavaScript file. You ship it with your activity — Nuwe loads your HTTPS site, not a shared CDN.

Recommended: starter repo

nuwe.js is included in the starter repo. Keep it next to index.html and deploy both together:

<script src="https://cdn.getforge.com/nuwe-providers.getforge.io/1788522862/nuwe.js"></script>

Methods

MethodPermissionReturns
nuwe.activity.start()sessionsession id, activity id, granted_context, started_from
nuwe.activity.complete(outcome)activity.completecompletion status
nuwe.activity.cancel({ reason })—dismissed session
nuwe.context.getCurrent()context.current_stateNow / Trend / Life rings
nuwe.context.getGoals()context.goalsarray of active goals
nuwe.context.getSession()context.sessionrecommendation + started_from
nuwe.context.getSignals()context.health_summarysleep / recovery / movement bands
nuwe.context.getConstraints()context.constraintsupcoming events & notes
nuwe.profile.getBasic()profile.basictimezone, locale, sex
nuwe.host.haptic(style)host.hapticslight | medium | heavy
nuwe.host.timer.start({ duration_s, tick_s, onTick, onDone })host.timercountdown with tick events
nuwe.host.timer.cancel()host.timerstops active timer

What you do NOT get

Boot sequence

  1. Nuwe opens your page in an in-app web view
  2. Call activity.start() — read granted_context and started_from
  3. Optionally read ?activity= from the URL
  4. Render your UI using context APIs you declared
  5. On finish call activity.complete(outcome); on exit without completion call activity.cancel()

Outcome schema nuwe.activity.outcome.v1

{
  "schema": "nuwe.activity.outcome.v1",
  "kind": "mobility | breathwork | checkin | wellness",
  "completed": true,
  "duration_seconds": 120,
  "self_report": {
    "perceived_effort": 3,
    "felt_better": true
  },
  "structured": {}
}

self_report.perceived_effort is optional, 1–5. structured is for activity-specific data Nuwe may use later.

Errors

Undeclared permissions return permission_denied. Your activity should still be completable without optional context.