Skip to main content
Version: 4.6.1-saas

Initialization Options

This document describes all initialization options available in the Netfunnel.instance.initialize() function.


Required Parameters

The initialization function requires the clientId parameter.

Getting Client ID

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.

ParameterDefault ValueRange
networkTimeout3000100–10000
retryCount00–10
useNetworkRecoveryModefalsetrue/false

networkTimeout

Maximum timeout period before a NetFUNNEL server API request is considered a temporary failure.

PropertyValue
UnitMilliseconds (ms)
Range100–10000
Default3000
Applies toNetFUNNEL 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 timeout
  • networkTimeout: 5000 → 5 second timeout

retryCount

Additional retry count for temporary failures in NetFUNNEL server API calls.

PropertyValue
Range0–10
Default0
FormulaTotal attempts = (set value) + 1
Applies toNetFUNNEL 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.

PropertyValue
TypeBoolean
Defaultfalse
BehaviorIf 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.

PropertyValue
TypeBoolean
Defaultfalse
Applies toDevelopment 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.

PropertyValue
TypeBoolean
Defaultfalse
BehaviorIf 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.

PropertyValue
TypeString
DefaultDefault NetFUNNEL server URL

When to Use:

  • Custom NetFUNNEL server deployment
  • On-premises installation
  • Special network configuration

errorUrl

Custom NetFUNNEL error page HTML address.

PropertyValue
TypeString
DefaultDefault 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.

PropertyValue
TypeBoolean
Defaulttrue
BehaviorIf 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.

PropertyValue
TypeString
Defaultnull

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.

PropertyValue
TypeString
Defaultprod_tokyo
Optionsprod_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