Getting Started
Ashgateway
Learn how to use ashgateway as a secure cloud proxy for your FedaPay integration.
Ashgateway
ashgateway is the recommended way to use feda_flutter in production. It acts as a secure intermediary between your mobile application and the FedaPay API.
Why use ashgateway?
Directly embedding your FedaPay secret API key (sk_live_...) in your mobile app is a major security risk. Attackers can decompile your app and steal your key.
ashgateway solves this by:
- Keeping keys secret: Your FedaPay keys are stored only on the server.
- Project-based access: The app uses a public
projectKeyinstead of a secret API key. - Enhanced Security: You can implement additional validation and rate limiting on the gateway.
Setup
To use ashgateway, initialize the SDK using applyCloudConfig:
import 'package:feda_flutter/feda_flutter.dart';
void main() {
FedaFlutter.applyCloudConfig(
projectKey: 'your_public_project_key',
cloudUrl: 'https://ashgateway.com',
);
runApp(const MyApp());
}
How it works
When you use Cloud Proxy mode:
- The SDK sends requests to
https://ashgateway.com/fedapay/v1/.... - It includes the
x-feda-project-keyheader to identify your project. - ashgateway resolves this project key to your secret FedaPay key and forwards the request to the official FedaPay API.
- The results are returned back to your app seamlessly.
You can deploy your own instance of ashgateway or use a managed one. Always ensure the
cloudUrl uses HTTPS.