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
| Method | Permission | Returns |
|---|---|---|
nuwe.activity.start() | session | session id, activity id, granted_context, started_from |
nuwe.activity.complete(outcome) | activity.complete | completion status |
nuwe.activity.cancel({ reason }) | — | dismissed session |
nuwe.context.getCurrent() | context.current_state | Now / Trend / Life rings |
nuwe.context.getGoals() | context.goals | array of active goals |
nuwe.context.getSession() | context.session | recommendation + started_from |
nuwe.context.getSignals() | context.health_summary | sleep / recovery / movement bands |
nuwe.context.getConstraints() | context.constraints | upcoming events & notes |
nuwe.profile.getBasic() | profile.basic | timezone, locale, sex |
nuwe.host.haptic(style) | host.haptics | light | medium | heavy |
nuwe.host.timer.start({ duration_s, tick_s, onTick, onDone }) | host.timer | countdown with tick events |
nuwe.host.timer.cancel() | host.timer | stops active timer |
What you do NOT get
- Raw HealthKit samples or numeric HRV / sleep hours
- Nuwe API tokens or arbitrary HTTP from the WebView
- Camera, microphone, location, or push notifications
Boot sequence
- Nuwe opens your page in an in-app web view
- Call
activity.start()— readgranted_contextandstarted_from - Optionally read
?activity=from the URL - Render your UI using context APIs you declared
- On finish call
activity.complete(outcome); on exit without completion callactivity.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.