Initialization Options
This document describes all initialization options available in the Netfunnel.instance.initialize() function.
Required Parameters
The initialization function requires the clientId parameter.
For how to get the Client ID and initialization examples, refer to the Quick Start document.
Network Configuration
Controls network behavior and timeout for NetFUNNEL server communication.
| Parameter | Default Value | Range |
|---|---|---|
networkTimeout | 3000 | 100–10000 |
retryCount | 0 | 0–10 |
useNetworkRecoveryMode | false | true/false |
networkTimeout
Maximum timeout period before a NetFUNNEL server API request is considered a temporary failure.
| Property | Value |
|---|---|
| Unit | Milliseconds (ms) |
| Range | 100–10000 |
| Default | 3000 |
| Applies to | NetFUNNEL server endpoints only |
Behavior:
- No response within timeout → Temporary failure
- Immediate error response → No timeout wait
- Each retry uses the same timeout setting
Examples:
networkTimeout: 1000→ 1 second timeoutnetworkTimeout: 5000→ 5 second timeout
retryCount
Additional retry count for temporary failures in NetFUNNEL server API calls.
| Property | Value |
|---|---|
| Range | 0–10 |
| Default | 0 |
| Formula | Total attempts = (set value) + 1 |
| Applies to | NetFUNNEL server endpoints only |
Behavior:
- Temporary failure → Triggers retry (if retry count > 0)
- Permanent failure → Exhausts all retry attempts
Examples:
retryCount: 0→ Total 1 attempt (no retry)retryCount: 2→ Total 3 attempts (initial + 2 retries)
useNetworkRecoveryMode
Maintains the waiting room and attempts reconnection when the network connection is lost while the waiting room is displayed.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Behavior | If true, attempts reconnection based on networkTimeout to maintain waiting room |
Use Cases:
- When users may experience temporary network interruptions
- To protect users from losing their queue position due to network issues
Debugging Configuration
printLog
Enables debug log output for troubleshooting.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Applies to | Development and debugging |
Example:
await Netfunnel.instance.initialize(
clientId: 'your-client-id',
printLog: true, // Enable console logging
);
When to Use:
- During development and testing
- When troubleshooting integration issues
- To understand NetFUNNEL behavior
Note: Disable in production for better performance.
Error Handling Configuration
errorBypass
Bypasses traffic control when an error occurs.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Behavior | If true, allows service access when NetFUNNEL encounters an error |
Use Cases:
- Graceful degradation when NetFUNNEL is unavailable
- Ensuring service continues even during NetFUNNEL issues
Server Configuration
serverUrl
Custom NetFUNNEL server address.
| Property | Value |
|---|---|
| Type | String |
| Default | Default NetFUNNEL server URL |
When to Use:
- Custom NetFUNNEL server deployment
- On-premises installation
- Special network configuration
errorUrl
Custom NetFUNNEL error page HTML address.
| Property | Value |
|---|---|
| Type | String |
| Default | Default error page URL |
When to Use:
- Custom error page design
- Branded error experience
- Localized error messages
Waiting Room Configuration
useNetfunnelTemplate
Uses custom NetFUNNEL waiting room template from the console.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | true |
| Behavior | If true, uses custom template configured in console |
When to Use:
- Custom branded waiting room
- Localized waiting room content
- Special waiting room design
User Identification
userId
End-user unique identifier for blacklist/whitelist verification.
| Property | Value |
|---|---|
| Type | String |
| Default | null |
Use Cases:
- Per-user access control
- Blacklist/whitelist management
- VIP user handling
Example:
await Netfunnel.instance.initialize(
clientId: 'your-client-id',
userId: 'user_12345', // User identifier for access control
);
Environment Configuration
profile
User environment configuration.
| Property | Value |
|---|---|
| Type | String |
| Default | prod_tokyo |
| Options | prod_tokyo, prod_us_east |
When to Use:
- When you want different settings per environment
- Production environment (Tokyo)
- Production environment (US East)
Examples:
// Production environment (Tokyo)
await Netfunnel.instance.initialize(
profile: 'prod_tokyo',
// ...
);
// Production environment (US East)
await Netfunnel.instance.initialize(
profile: 'prod_us_east',
// ...
);
Complete Configuration Example
import 'package:netfunnel_flutter/netfunnel_flutter.dart';
await Netfunnel.instance.initialize(
// Required
clientId: 'your-client-id',
// Network configuration
networkTimeout: 3000,
retryCount: 0,
useNetworkRecoveryMode: false,
// Debugging
printLog: false,
// Error handling
errorBypass: false,
// Server configuration
serverUrl: null, // Use default
errorUrl: null, // Use default
// Waiting room
useNetfunnelTemplate: true,
// User identification
userId: null,
// Environment configuration
profile: 'prod_tokyo',
);
Parameter Validation
clientId
- Required
- Type: String
- Validation: Cannot be empty string
- Source: NetFUNNEL Console → Profile Icon →
Integration Credentials
networkTimeout
- Optional
- Type: int
- Range: 100–10000 (milliseconds)
- Default: 3000
retryCount
- Optional
- Type: int
- Range: 0–10
- Default: 0
printLog
- Optional
- Type: bool
- Default: false
errorBypass
- Optional
- Type: bool
- Default: false
useNetfunnelTemplate
- Optional
- Type: bool
- Default: true
userId
- Optional
- Type: String or null
- Default: null
useNetworkRecoveryMode
- Optional
- Type: bool
- Default: false
profile
- Optional
- Type: String
- Default: prod_tokyo
- Options: prod_tokyo, prod_us_east
Related Documentation
- Installation and Initialization: Setup guide with initialization examples
- API Reference: Function specifications and usage
- Troubleshooting: Common issues and solutions