Skip to content
Getting started

Getting started

The end-to-end path from getting an AppCore account to the first sign-in, sandbox purchase and push in a Flutter app.

On this page

This page takes you from an empty account to a Flutter build that signs a user in, makes a sandbox purchase and receives a push notification, all against a staging environment. Each step links to the detailed guide for it.

Important

AppCore is pre-release. A provider-backed feature is off until its connection is active and its checks pass. Until then the API returns 503 FEATURE_UNAVAILABLE and the SDK throws FEATURE_UNAVAILABLE. AppCore never returns a simulated success. No provider integration has been verified against a live provider account yet (none is PROVIDER_TESTED). Every check described here exists in code and has been tested against fake provider transports or test keys only.

Note

The operator console screens named on this page are built and tested against sample data (MOCK_TESTED). They have not yet been run against a live control plane. If a console screen fails, the same action is available through the API (see Control plane and Connections).

Before you begin

  • A Flutter project (Dart >=3.5.0, Flutter >=3.24.0) with separate build flavors per environment, each with its own Android applicationId and iOS bundle ID (for example com.example.app.staging and com.example.app).
  • Accounts you control for the providers you plan to use: Google Cloud / Firebase, an Apple Developer Program membership with App Store Connect access, a Google Play Console developer account, and a domain on Cloudflare DNS for email.
  • Read Tenancy and scopes and Environments. Everything below happens once per environment.

1. Get an AppCore account

Warning

Self-serve sign-up is not available yet. The control plane creates tenants only for a platform operator (the tenant.create permission belongs only to the platform_owner role). A public sign-up page is planned but not built. For now, a platform operator creates your organization and first app and invites you.

  1. Ask your AppCore platform operator to create your organization (tenant) and first app. They need your legal entity name, country, app display name and which environments you want (development, staging, production).
  2. The operator invites your email address as tenant owner (or a narrower role such as app_admin or developer).
  3. Open the AppCore console and sign in with your email. The console sends a 6-digit one-time code. Operators have no passwords.
  4. If your role is privileged (for example tenant owner or app admin), turn on two-step sign-in from the account menu: Account menu → Two-step sign-in. The console shows a banner until you do.

2. Create an app and its environments

A tenant is your organization. An app is one consumer product across Android and iOS. Each environment (development, staging, production) of an app gets its own runtime Worker, its own database, its own provider connections and its own API host. Nothing is shared between environments or between apps, even within one tenant.

  • The first app is created together with your tenant (step 1).
  • To add another app, a tenant owner opens Setup and connections → Set up an app, or calls POST /v1/control/tenants/{tenant_id}/apps with the display name, Android package ID and iOS bundle ID. A package or bundle ID that already belongs to another app is rejected with 409 STORE_ID_TAKEN. A new app gets the same environments as your first app and copies its branding.

Each environment is provisioned by a resumable job: create database → migrate → seed scope → deploy runtime → generate runtime secrets → wire route → publish connections → push policy → health check. Follow it in Operations and settings → Jobs and failures.

Pick the environment you are working on from the scope switcher at the top of the console (Apps and environments). Production is always labelled with text and an icon.

Find your API host. Open Fleet and organizations → Environments and copy the API origin of your staging environment. The rest of this documentation writes it as https://<your-api-host>. It is public; it goes into your Flutter build and into provider consoles as the base of callback URLs.

3. Connect providers

Connect only what your app needs. A free app can launch without store connections; push is optional because the app has an in-app inbox.

You wantConnectGuide
Sign in with GoogleGoogle Sign-In (google_auth)Google sign-in
Sign in with AppleSign in with Apple (apple_auth)Sign in with Apple
Email one-time codes and transactional emailCloudflare Email Sending (cloudflare_email)Cloudflare Email Sending
Push on Android and iOSFirebase Cloud Messaging (firebase_fcm) plus an APNs key (apple_apns)Firebase Cloud Messaging and APNs
iOS in-app purchases and subscriptionsApp Store (apple_store)App Store Connect
Android in-app purchases and subscriptionsGoogle Play (google_play)Google Play
WhatsApp one-time codes (optional, deferred)Meta WhatsApp (meta_whatsapp)WhatsApp

See the provider index for what each one enables and its current status.

Every connection follows the same lifecycle in Setup and connections → Connections → provider:

  1. Create the connection. The console now shows its connection ID, and for webhook-based providers a Callback URL with a copy button. Paste that exact URL into the provider console.
  2. Public fields: fill in IDs and settings, then save.
  3. Secrets: paste each secret (.p8 key, service-account JSON) into its write-only field. The value is never shown again; the console only shows Configured and a version. Delete your local copy afterwards.
  4. Check syntax, then Read-only check. The read-only check calls the real provider without side effects (no message, no charge) where AppCore can automate it.
  5. Activate, with a reason (saved in the audit log). In development and staging, activation needs passing read-only evidence. The connection then shows pending_approval and is usable for sandbox testing.
  6. Record evidence for the explicit checks (a test login, a test notification, a sandbox purchase). When every sandbox check has evidence, the connection becomes sandbox_ready.

Warning

Not yet in the console: the connection page has no Record evidence button yet. Record evidence through the API: POST /v1/connections/{connection_id}/evidence with stage, check_id, outcome, a note of 10–1000 characters, an evidence_ref (the transaction, notification or login ID) and expected_version. Send the environment in the appcore-resource-set-id header. Checks that AppCore automates cannot be hand-attested (409 CHECK_IS_AUTOMATED).

Connection states are not_configured, draft, pending_approval, invalid, sandbox_ready, production_ready, degraded, expired and disabled. Setup and connections → Setup checklist lists the manual tasks (store agreements, product creation, testers) that block activation, with who owns each one.

4. Publish the public configuration

Activating, rotating or disabling a connection publishes a new configuration snapshot to the environment's runtime automatically: secrets go to the runtime first, then the secret-free snapshot. Your app reads the result from:

Code
GET https://<your-api-host>/v1/config/public

The response lists only what is really usable: auth_methods, messaging_channels, purchase_providers, plus app_id, environment_id, config_version and minimum_sdk_version. It never contains secrets, account IDs or binding names.

  • Before anything has been published, this endpoint returns 503 FEATURE_UNAVAILABLE with "App configuration has not been published yet", and AppCore.init fails.
  • If delivery to the runtime failed, GET /v1/connections/publication shows the error and POST /v1/connections/publish retries it.
  • Setup and connections → Flutter setup shows the public values your build needs.

5. Install the Flutter SDK

The package appcore_sdk is not on pub.dev yet. Add it as a git or path dependency, then add only the native plugins your bridges need. Full details: Flutter SDK.

YAML
# pubspec.yaml
dependencies:
  appcore_sdk:
    git:
      url: <appcore-sdk-git-url>
      path: sdk/flutter
      ref: <tag-or-commit>

Copy the reference adapters you need from examples/flutter-reference/lib/adapters/ (PlatformSecureStore, IapStoreBridge, FcmPushBridge, GoogleSignInBridge, AppleSignInBridge) into your app.

Initialise once per launch. One binary targets exactly one app and one environment; pass the values per flavor with --dart-define.

Dart
import 'dart:io';
import 'package:appcore_sdk/appcore_sdk.dart';

final core = await AppCore.init(
  manifest: AppCoreManifest(
    apiBaseUrl: Uri.parse('https://<your-api-host>'),
    appId: '<your-app-id>',          // must equal app_id in /v1/config/public
    environmentId: 'staging',         // development | staging | production
    platformProvider: Platform.isIOS ? 'apple' : 'google_play',
    deepLinkScheme: '<your-scheme>',
  ),
  secureStorage: PlatformSecureStore(),
  appVersion: '1.0.0',
);

init throws APP_ENVIRONMENT_MISMATCH if the host serves another app or environment, and APP_UPDATE_REQUIRED if the SDK is older than minimum_sdk_version. Release builds require HTTPS.

6. First sign-in

Use a method listed in auth_methods from /v1/config/public. The SDK throws FEATURE_UNAVAILABLE for any other.

Email one-time code (needs Cloudflare Email Sending):

Dart
final challenge = await core.auth.requestOtp(method: 'email_otp', destination: 'tester@example.com');
// The user types the 6-digit code from the email.
final result = await core.auth.verifyOtp(challengeId: challenge.challengeId, code: code);
print(result.user.id);

Google or Apple (needs Google sign-in or Sign in with Apple):

Dart
final result = await core.auth.signInWithSocial(
  GoogleSignInBridge(serverClientId: '<web-oauth-client-id>'),  // or AppleSignInBridge() on iOS
);
if (result == null) { /* user cancelled */ }

The session token is stored in secure storage. Accounts are keyed by the provider's subject: a matching email address never merges two accounts.

Verify: the new user appears in Users and access → Users (masked), and the login session ID is the evidence_ref for the connection's login check.

7. First purchase in sandbox

Apple and Google are the merchant of record for store sales. AppCore verifies each purchase with the store, then grants entitlements. See Stores as merchant of record and Entitlements and credits.

  1. Create the product in the store first: App Store Connect (Apps → your app → Monetization) and/or Play Console (Monetize with Play → Products). Note the exact product IDs.
  2. In AppCore, create and publish the product and its plan in Products and entitlements → Catalog, then map each store product ID in Products and entitlements → Store mappings. An unmapped product returns 404 PRODUCT_NOT_MAPPED.
  3. Make sure the apple_store and/or google_play connection is active in staging (store_environment = sandbox for Apple).
  4. Set up testers: Apple sandbox testers (App Store Connect → Users and Access → Sandbox → Test Accounts) and Play licence testers (Play Console → Settings → License testing).
  5. In the app:
Dart
await core.commerce.attach(IapStoreBridge());
core.commerce.states.listen((s) => print(s)); // creatingIntent → awaitingStore → verifying → verified

final catalog = (await core.commerce.products()).items;
final store = await core.commerce.storeProducts(catalog);
final product = catalog.first;
final storeProduct = store[product.mappingFor(IapStoreBridge().provider)!.productId]!;
await core.commerce.purchase(product, storeProduct);

final snapshot = await core.entitlements.refresh();
print(snapshot.feature('<feature-key>')?.allowed);

The SDK finishes the store transaction only after AppCore accepts it. Prices shown to users come from the store, not from AppCore. Staging and development accept only sandbox purchases; production accepts only live ones.

Verify: the purchase appears in Purchases and finance → Purchases, and the user's access shows in Products and entitlements → Entitlements. Record the transaction ID as evidence for iap-sandbox-purchase or play-sandbox-purchase.

8. First push

Needs Firebase Cloud Messaging and APNs, and a signed-in user on a real device.

Dart
await core.messaging.attach(FcmPushBridge());
final permission = await core.messaging.requestPermission(); // registers the device when signed in

Verify the registration: the device appears in Messaging and engagement → Devices and inbox (token never shown).

Warning

Not yet in the console or SDK: an operator test send. The runtime implements it, but the routes are not in the published API contract and neither the console nor the SDK calls them yet. Until they do, call the runtime through the control plane: create a push template in Messaging and engagement → Message templates, then POST /v1/messaging/test-devices/pairings (returns a 10-minute pairing code), claim it from the signed-in app with POST /v1/messaging/test-devices/claim (pairing_code, installation_id), then POST /v1/messaging/templates/{template_id}/test-send with installation_id and confirm: true. A test send only ever reaches a device you paired yourself, at most 10 per hour.

In development and staging, regular (non-test) pushes are sent only once the FCM connection is sandbox_ready, that is after the device test is recorded as evidence. A successful send means FCM accepted the message, not that it was displayed.

Troubleshooting

SymptomCauseFix
AppCore.init fails with FEATURE_UNAVAILABLE "App configuration has not been published yet"No snapshot has reached the runtimeActivate at least one connection, then check GET /v1/connections/publication; retry with POST /v1/connections/publish
APP_ENVIRONMENT_MISMATCHappId/environmentId in the build differ from /v1/config/publicUse the values from Setup and connections → Flutter setup for this flavor
A sign-in or purchase method is missing from /v1/config/publicIts connection is not active, or (for email OTP) delivery is not readyOpen the connection; run the read-only check; activate
409 EVIDENCE_REQUIRED on ActivateThe current configuration has no passing read-only (staging) or production evidenceRun Read-only check on the saved configuration; attest manual checks
409 LAST_TEST_FAILED on ActivateThe latest test of this exact configuration failedFix the field named in the findings and test again
409 "Changed since you opened it"Someone else edited the connectionReload and re-apply your change
Webhook returns 404The URL has a connection ID that is not the active connection for this environmentCopy the Callback URL again from the active connection
Webhook returns 503 FEATURE_UNAVAILABLEThe connection is not active yetActivate it, then resend the provider test

Next steps

  • Flutter SDK — every module, error handling and offline behaviour.
  • API reference — authentication channels, idempotency keys and problem codes.
  • Environments — promoting from staging to production. Production connections need their own credentials (never reuse a staging key), production-stage evidence and all blocking setup tasks done.