The video uses a specific AI coding tool to demonstrate the setup, but the configuration works 1:1 with Cursor, Claude Code, or any other tool. Despia is web framework and tooling agnostic, so the only things that matter are the SDK call, the public SVG URL, and the refresh interval.
widget:// registers a remote SVG endpoint as the source for an iOS home screen widget. The OS fetches the SVG at the interval you set, swaps the rendered widget contents, and shows the new state on the home screen even when your app is closed. Your backend personalizes the SVG per user by reading the request, looking up the data, and substituting tokens like {NAME} and {SCORE} before responding.
Home Widgets is currently iOS-only. The Android equivalent uses a different rendering pipeline (RemoteViews) that does not accept SVG content. Plan widget UX around iOS first, and gate the SDK call behind
isDespiaIOS so Android users do not see a broken affordance.Apple Developer and Despia setup
Home Widgets on iOS runs as a separate Widget Extension target with its own bundle identifier. The widget and your core app communicate through an App Group, which is what lets the widget reach into shared storage when it builds the SVG payload. You configure the bundle ID and App Group in Apple Developer, then enable the target in the Despia Editor and rebuild.Sign in to Apple Developer
Go to developer.apple.com and sign in with the Apple Developer account that owns your app’s primary bundle ID. Navigate to Certificates, Identifiers & Profiles > Identifiers.
Create the App Group
Click the + button next to Identifiers, choose App Groups, and click Continue. Use a description like
MyApp Widget Group and the identifier group.com.despia.myapp.widgetsharing. Click Continue, then Register. The widgetsharing suffix is the official Despia naming, do not invent your own.Add the App Group to your core app bundle ID
Back in Identifiers, find your core app (e.g.
com.despia.myapp), click into it, and check App Groups. Click Edit, select the group.com.despia.myapp.widgetsharing group you just created, then Continue and Save.Create the Widget Extension bundle ID
Click + under Identifiers again, choose App IDs, then App. Use a description like
MyApp Image Widget and the bundle ID com.despia.myapp.ImageWidget (your core bundle ID with .ImageWidget appended). This exact naming is what Despia provisions during the build, do not change it.Add the App Group to the Widget Extension bundle ID
Scroll down to Capabilities, check App Groups, click Edit, and select the same
group.com.despia.myapp.widgetsharing group. Click Continue and Save. Both bundles now share storage, which is how the widget reads user-specific data the core app wrote.Enable Home Widgets in the Despia Editor
Open the Despia Editor and go to App > Targets > Home Widget. Toggle the integration on.
Rebuild your app
Trigger a fresh build from the Despia Editor. The widget target has to be compiled into your app binary and signed with the matching provisioning profile, so this cannot be applied over-the-air. After the build finishes, the widget becomes available for users to add to their home screen, and your
widget:// SDK call sets the SVG source.Installation
- Bundle
- CDN
How it works
Pass a publicly accessible HTTPS URL to a server endpoint that returns SVG, plus a refresh interval in minutes. The OS picks up the URL on the next widget refresh cycle and treats it as the new source.Scheme parameters
| Position | Value | Notes |
|---|---|---|
| URL | A full HTTPS URL to your SVG endpoint | Must respond with Content-Type: image/svg+xml. Use a path that includes the user ID so each user gets their own widget |
refresh | Minutes between refreshes | Whole minutes only. Common values: 1, 2, 3, 5, 10, 15, 30, 60. iOS may extend the interval under battery pressure, so treat your value as a minimum, not a guarantee |
Register the widget after login
The natural place to register or update the widget is right after authentication, since that is when you have the user ID needed to personalize the URL. Re-call on every authenticated app load to handle users who switch accounts.refresh value. The OS replaces the previous registration with the new one.
Backend SVG endpoint
The endpoint receives the request, loads the user’s data, substitutes the tokens, and returns the SVG with the correct content type. Keep the SVG simple, the home screen renders it at a fixed size and ignores most CSS animations.- Always escape user input. A user with a name like
Bob & "Friends"will break the SVG without escaping, and a malicious user could inject markup that breaks rendering for everyone. TheescapeXmlhelper above covers the five XML-significant characters. - Send
Cache-Control: no-storeso iOS does not cache an older version of the SVG between refreshes. The widget will only ever look as fresh as the most recently cached response.
Refresh interval guidance
iOS does not honor your refresh interval literally. The OS schedules widget updates in batches and may stretch your interval based on battery state, network quality, and how often the user is actually looking at the home screen. Use these intervals as rough targets:| Interval | Practical use |
|---|---|
1 to 2 minutes | Live scores, active timers, real-time tracking. iOS may still throttle to 5 minutes under battery pressure |
5 to 15 minutes | Stocks during market hours, weather, recently active app data |
30 to 60 minutes | Daily summaries, dashboards, content that updates a few times a day |
60 plus | Static or near-static content where freshness barely matters |
Resources
NPM Package
despia-native