MyazaPOSConfig
Pass a configuration object when creating aMyazaPOS instance:
Options
Your Myaza merchant ID from the dashboard.
Enable sandbox mode for testing without real funds.
Override the API base URL. Defaults to the production or sandbox URL based on
isSandbox.Pre-select a blockchain in the checkout modal (e.g.
"polygon").Pre-select a token in the checkout modal (e.g.
"USDC").How often to poll for payment status in milliseconds.
Maximum duration to poll before timing out.
Timeout for individual API requests in milliseconds.
Maximum number of retries for failed API requests.
URL to redirect the customer to after payment completes.
Configure fraud detection rules. See Fraud Detection below.
Register plugins at initialization. See the Plugins guide.
Theme
Customize the look and feel of the checkout modal:ThemeConfig
| Property | Type | Description |
|---|---|---|
primaryColor | string | Primary brand color for buttons and accents |
secondaryColor | string | Secondary color for hover states and highlights |
backgroundColor | string | Modal background color |
textColor | string | Primary text color |
borderRadius | number | Border radius in pixels for UI elements |
fontFamily | string | CSS font family string |
logoUrl | string | URL to your logo displayed in the modal header |
colorScheme | 'dark' | 'light' | 'system' | Color scheme preference |
customCss | string | Additional CSS injected into the modal |
Fraud Detection
The SDK includes a built-in fraud engine that evaluates payments before processing:FraudConfig
| Property | Type | Description |
|---|---|---|
blockedAddresses | string[] | Wallet addresses to block outright |
maxAmountUsd | number | Maximum payment amount in USD |
velocityLimitPerHour | number | Max payments per hour before flagging |
blockThreshold | number | Fraud score (0-100) that triggers automatic blocking |
reviewThreshold | number | Fraud score that triggers manual review |
customChecks | FraudCheckFn[] | Custom check functions returning FraudSignal or null |
Fraud Signals
When a fraud check triggers, the SDK emitsfraud.review_started and fraud.review_completed events:
| Signal Type | Description |
|---|---|
velocity_exceeded | Too many payments in a short period |
address_blacklisted | Wallet address is on the block list |
amount_anomaly | Amount exceeds configured maximum |
device_fingerprint | Suspicious device characteristics |
custom | From your custom check functions |
Telemetry
Configure logging and performance tracking:| Property | Type | Description |
|---|---|---|
logLevel | 'debug' | 'info' | 'warn' | 'error' | Minimum log level |
otelEndpoint | string | OpenTelemetry collector endpoint |
enablePerformanceTiming | boolean | Emit performance.timing events |

