Skip to main content

prophetx_sdk 0.5.0 copy "prophetx_sdk: ^0.5.0" to clipboard
prophetx_sdk: ^0.5.0 copied to clipboard

ProphetX Flutter SDK — embed deposit, withdraw, KYC and onboarding flows in Flutter apps.

prophetx_sdk #

ProphetX Flutter SDK — embed deposit, withdraw, KYC, and onboarding flows in Flutter apps.

Mirrors the surface of @prophetx/sdk-react-native: a single root provider widget, four imperative flow controllers, an auth manager, a wallet client, and an event bus. The transport is webview_flutter with a JavaScriptChannel (ProphetXChannel) and the same PROPHETX_* postMessage contract used across the ProphetX embed surface.

Installation #

dependencies:
  prophetx_sdk: ^0.5.0

Then flutter pub get.

Quick start #

import 'package:flutter/material.dart';
import 'package:prophetx_sdk/prophetx_sdk.dart';

void main() {
  // Your backend mints this ProphetX session JWT for the signed-in user.
  const jwt = '<partner-session-jwt>';

  runApp(
    ProphetXProvider(
      environment: EnvironmentName.staging,
      token: jwt,
      theme: const EmbedTheme(primaryColor: '#6366f1'),
      locale: 'en',
      child: const MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Builder(
            builder: (context) {
              final px = ProphetX.of(context);
              return ElevatedButton(
                onPressed: () => px.deposit.open(OpenDepositOptions(
                  onSuccess: (id, amt) => debugPrint('deposit success $id'),
                  onCancel: () => debugPrint('cancelled'),
                )),
                child: const Text('Deposit'),
              );
            },
          ),
        ),
      ),
    );
  }
}

Public API #

API Description
ProphetXProvider(environment, token, theme, locale, onSessionExpired, auth, devtools, child) Root widget. Creates the auth manager, wallet client, event bus, and five flow controllers.
ProphetX.of(context).deposit / withdraw / onboarding / kyc / idUpload ChangeNotifier flow controllers exposing open(options?), close(), isOpen.
ProphetX.of(context).auth AuthManager? — non-null only when auth: is passed to the provider.
ProphetX.of(context).wallet WalletClient? — non-null only when auth: is passed. refetch() returns WalletBalance.
ProphetX.of(context).events ProphetXEventBus. Subscribe via .stream, which is a broadcast Stream<ProphetXEvent>.
ProphetXWebView Lower-level widget for partners who want to render the embed without the modal chrome.
ProphetXModal Full-screen modal with header (close button) and loading overlay; used internally by the provider.
PoweredByProphetX Brand attribution widget.

auth and wallet are nullable: they are only constructed when you pass an AuthConfig to ProphetXProvider(auth: ...). If you manage tokens yourself via the token: parameter, both stay null.

Environments #

Env embedUrl apiBaseUrl
production https://embed.prophetx.co https://isv-api.prophetx.co
staging https://isv-embed-fe-embed.vercel.app https://isv-api.staging.prophetx.dev
sandbox https://isv-embed-fe-embed-sandbox.vercel.app https://isv-api.sandbox.prophetx.dev

Pass an explicit EnvironmentConfig to point at a custom embed/api host.

Events #

ProphetX.of(context).events is a ProphetXEventBus; .stream is a broadcast Stream<ProphetXEvent>:

ReadyEvent
SuccessEvent(transactionId, amount?)
ErrorEvent(code, message)
CancelEvent
KycSuccessEvent(identityUuid)
KycFailedEvent(reason)
KycPendingEvent
GeofenceBlockedEvent(stateCode, reason)
SessionExpiredEvent
SessionRefreshedEvent(token)
FlowOpenEvent(flow)
FlowCloseEvent(flow)

Filter with bus.on<SuccessEvent>(handler) or subscribe to the union via bus.stream.listen(...).

Platform notes #

  • iOS / Android. No special configuration beyond webview_flutter's standard requirements.
  • AeroPay OAuth bank linking. Banks that use OAuth refuse to authenticate inside a WebView, so their login opens in the device browser and returns via a deep link. That needs three things from your app: pass your bare URL scheme as appLink, register it with the OS, and consume the inbound link without navigating — the default Flutter handling pushes a route over the still-open embed and discards the flow the user is returning to. Full guide: https://isv-embed-fe-storybook-product.vercel.app/?path=/docs/product-oauth-bank-linking--documentation
  • Cleartext traffic (sandbox/dev only). Android requires android:usesCleartextTraffic="true" in AndroidManifest.xml if EnvironmentConfig.apiBaseUrl points at an HTTP origin. Production / staging are HTTPS, so the default config works.

Documentation #

Issues & support #

Email support@prophetx.co.

License #

Proprietary — © 2026 ProphetX LLC, all rights reserved. Use is governed by the ProphetX Developer Agreement. See LICENSE.

0
likes
130
points
583
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

ProphetX Flutter SDK — embed deposit, withdraw, KYC and onboarding flows in Flutter apps.

Homepage

License

unknown (license)

Dependencies

flutter, flutter_secure_storage, flutter_svg, http, url_launcher, uuid, webview_flutter

More

Packages that depend on prophetx_sdk