Introduction

Integration from a local-only app

Your product already works on a single device: user data lives on that phone, tablet, or browser, and there is no shared account system. This page shows how to add secureFlows — mainly by giving an AI coding tool the right prompts — so people can sign in, keep their data across devices, and stay private from each other.

Who this is for

Use this guide when all of the following are true:

Brand-new app with no existing local data? Use the Integration Walkthrough instead. Already using Auth0, Cognito, or your own user table? That is a different migration — this page assumes the device was the only place durable data lived.

Before the prompts: create a workspace and register an application in Workspace Management (you will need the workspace name and application ID). The walkthrough covers that setup if you have not done it yet.

What changes

Today (local-only) After secureFlows
Who the user is Whoever is using this device or install A signed-in person (secureFlows shows the sign-in screen; you never handle passwords)
Where data lives Only on that device — wipe or reinstall and it is gone In secureFlows as the app’s main user database (kept by default)
Other devices No way to continue on another phone, tablet, or laptop Same person signs in elsewhere and sees their data
Your product UI Everything is local features only Still your screens and features — secureFlows adds sign-in and private storage underneath

One idea to keep

One place for lasting data

After you switch, treat secureFlows as the real home for user content. The device can still hold temporary things (drafts, caches, offline queues), but not a second permanent copy that can disagree with what is already saved in the cloud.

Integration prompts

Paste the block below into your AI coding tool (Cursor, Claude Code, Lovable, Base44, and similar). Replace the placeholders with your workspace name and application ID from the console. Keep the Why line — it tells the tool this is an intentional architecture change, not a conflict with “local-only” notes in the old project.

Prompt A — add sign-in and move lasting storage to secureFlows

This app already stores user data only on the device (no shared accounts).

Use secureFlows for auth and data storage (read https://www.secure-flows.com/ai/secureflows-integration/SKILL.md).
Use: workspace = <YOUR_WORKSPACE>, appId = <YOUR_APP_ID>
Why: moving from local-only on-device storage to multi-user secureFlows.

Add secureFlows hosted login (Continue with secureFlows / Sign out).
After sign-in, save and load this app’s lasting user data through secureFlows — not as a second permanent copy on the device.
Keep describing the product features as they are today: <brief description of what the app does and what it stores>.

Run this after the workspace and application exist. If the tool asks for API keys or passwords, something is wrong — secureFlows integrations never need those from you.

Migrating existing local data

People who already used the app on a device still have old data sitting locally. Use a second prompt after Prompt A works (sign-in and cloud save/load feel correct for a new user).

Prompt B — import this device’s old data once

After a user signs in with secureFlows for the first time on a device that still has old local data from before accounts existed:

1. If their secureFlows record is empty, import the old on-device data into secureFlows once, then stop treating that local copy as the source of truth.
2. If they already have data in secureFlows (e.g. they signed in on another device first), do NOT overwrite the cloud copy with old local leftovers. Keep the cloud data. Optionally offer a clear “Import this device’s old data” choice only when the user asks for it.
3. Never re-import on every launch.

Use the same secureFlows workspace/appId and SKILL.md as before.
The local data looks like: <short description — e.g. “name and age in localStorage” or “notes list in SQLite”>.

Adjusting the prompts for your app

Where to go next

Setup and plain-language sign-in story: Integration Walkthrough. More questions: Q&A. The reference your AI tool reads: SKILL.md.

Advanced (optional)

For engineers who want the mechanical checklist behind those prompts. Most teams can skip this and stay with Prompts A and B.

Recommended sequence

  1. Provision workspace + application (redirect URI = app origin + /callback).
  2. Add hosted login; store the session token only in short-lived client storage (web: sessionStorage, never localStorage).
  3. Route new lasting writes through secureFlows once the user is signed in.
  4. One-time import of on-device data after first sign-in on that device (Prompt B).
  5. Verify: user A saves → sign out → user B must not see A’s data.
  6. Stop treating on-device keys as authoritative; optionally delete migrated local copies.

Migration details

Prefer importing only when the cloud record is empty. If cloud data already exists, keep it unless the user explicitly chooses to import this device’s leftovers. Mark migration done so it never runs again on every launch. Stay within plan payload size limits; large files belong in object storage with URLs in the payload.

Pitfalls

Wire-level HTTP: Integration Quickstart.