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, your own user table, or a platform's built-in auth and database? Use Integration from an app with its own backend instead — 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 lasting per-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. Not every local key needs to move — sketch that split yourself first (next section), then compare it to what the AI proposes.

Sketch your data map first

No one knows this app better than you do — you don’t need any technical background to do this well. This step isn’t mandatory — Prompt A works even if you skip it — but it’s one of the most effective ways to get the AI’s first proposal right instead of correcting it afterward. Before you read what the AI proposes, write your own quick answer. This is not busywork: comparing two independent answers catches a mistake — like something ephemeral getting persisted, or a shared reference list getting treated as user data — that reading one confident-looking table usually does not.

Walk through your app one screen or feature at a time. For each thing it stores or shows, ask:

Write one line per item, in this shape:

- <screen or feature>: <what it stores> → <keep forever / just while using / not user-specific>

Example, for a simple notes app:

- Notes list: note titles and text → keep forever
- New-note screen: the note a user is currently typing, before they hit save → just while using
- Search box: whatever a user has typed to filter the list → just while using
- Settings: dark mode on/off → keep forever
- Tips screen: the built-in list of writing tips shown to every user → not user-specific

Don’t worry about getting every line “right” — the point is to have your own answer ready to compare, not to pre-solve the migration yourself. When you’re done, paste your list into Prompt A below, where it says <PASTE YOUR DATA SKETCH HERE>.

Integration prompts

Use the prompts in order. Prompt A teaches the tool what secureFlows is (via SKILL.md), then asks it to propose which local data should move, and only then implement sign-in and storage. Prompt B comes later, once cloud save/load works for a new user.

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 — learn secureFlows, agree the data map, then implement

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.

Here is my own data sketch, before you propose yours (see "Sketch your data map" above for how I made
this). Compare your proposal to it line by line and call out anything you disagree with — don't just
silently pick one version:

<PASTE YOUR DATA SKETCH HERE>

Do this in order. Stop after step 1 and wait for my confirmation before writing code:

1. Read the SKILL. Review this app’s current on-device data and propose a short plan:
   (a) lasting per-user fields that should live in secureFlows (needed across devices),
   (b) device-only caches / drafts / ephemeral UI state,
   (c) anything that's not user-specific (e.g. built-in reference content every user sees the same
       copy of) — leave this where it is, it isn't user data,
   (d) large files or images that exceed the payload size cap — keep those in private object storage
       (not a public bucket), put only an opaque object id or key in secureFlows, and serve the bytes
       via short-lived signed URLs or an authenticated download after the session is checked.
       Do not store permanently public file URLs; anyone with the link could fetch them.
   Compare this against my sketch above and flag any disagreement explicitly.
2. After I approve the plan: add secureFlows hosted login (Continue with secureFlows / Sign out).
3. Save and load only the approved lasting fields 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>.

If the tool starts coding before you approve the data map, stop it and point it back to step 1. If its plan doesn’t address every line in your sketch — or disagrees without saying why — ask before approving. If it 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. Run Prompt A: tool reads SKILL, proposes which local fields move vs stay local, you confirm.
  3. Add hosted login; store the session token only in short-lived client storage (web: sessionStorage, never localStorage).
  4. Route approved lasting writes through secureFlows once the user is signed in.
  5. One-time import of on-device data after first sign-in on that device (Prompt B).
  6. Verify: user A saves → sign out → user B must not see A’s data.
  7. 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 private object storage with an opaque id/key in the payload, served via signed URLs or an auth-checked download — not permanently public links.

Pitfalls

Wire-level HTTP: Integration Quickstart.