You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,5 +101,5 @@ The following documentation files provide detailed guidance for specific areas o
101
101
102
102
### `docs/ramp-plugin-migration-guide.md`
103
103
104
-
**When to read**: Before migrating ramp plugins from legacy provider architecture to new ramp plugin architecture
105
-
**Summary**: Comprehensive migration guide for removing FiatPluginUi abstraction and using direct API imports. Covers migration of toasts, modals, navigation, permissions (with important boolean logic inversion note), and wallet operations with before/after code examples. Essential for converting legacy fiat providers to new ramp plugins.
104
+
**When to read**: Before migrating ramp plugins from legacy provider architecture to new ramp plugin architecture or when creating new ramp plugins
105
+
**Summary**: Comprehensive migration guide for removing FiatPluginUi abstraction and using direct API imports. Covers migration of toasts, modals, navigation, permissions (with important boolean logic inversion note), wallet operations, and environment configuration requirements. Includes detailed steps for creating init options cleaners, validating plugin initialization, and registering plugins in envConfig. Essential for converting legacy fiat providers to new ramp plugins and ensuring proper type safety.
5.**Testing**: Test all flows thoroughly after migration, especially permission flows
199
199
6.**Type safety**: Use proper TypeScript types for all imported functions
200
200
201
+
## Environment Configuration
202
+
203
+
When creating a new ramp plugin, you must properly configure the plugin's initialization options to ensure type safety and centralized configuration management. This involves three steps:
204
+
205
+
### 1. Create Init Options Cleaner
206
+
207
+
In your plugin's types file (e.g., `moonpayRampTypes.ts`), create an `asInitOptions` cleaner that validates the structure of your plugin's initialization options:
208
+
209
+
```typescript
210
+
// Init options cleaner for moonpay ramp plugin
211
+
exportconst asInitOptions =asString// For simple API key
This setup ensures that when the app loads plugin configurations from environment variables or config files, they are properly validated before being passed to the plugin factories.
320
+
201
321
## Complete Migration Example
202
322
203
323
Here's a comparison showing a typical permission request migration:
0 commit comments