Flutter SDK Configuration
Understand how to configure keys, clients, and theme branding.
The SnapIt SDK is stateless and does not require global static initialization. You simply pass your credentials (apiKey and userId) directly when launching the try-on UI flow or when executing direct API calls using SnapITClient.
1. Custom UI Theme Configuration (SnapITTheme)
You can customize the SDK's visual components to match your application's brand using SnapITTheme:
theme_example.dart
import 'package:flutter/material.dart';
import 'package:snapit_sdk/snapit_sdk.dart';
final customTheme = SnapITTheme(
primaryColor: const Color(0xFFFF3F6C), // Your brand highlight color
backgroundColor: const Color(0xFF09090B), // SDK background color
cardColor: const Color(0xFF18181B), // SDK card surface color
textColor: Colors.white, // Text color
borderRadius: 16.0, // Rounded corners radius
fontFamily: 'Outfit', // Custom typeface
);2. Direct API Client Configuration (SnapITClient)
If you want to invoke VTON rendering or upload assets programmatically without displaying the default user interface flow, instantiate a SnapITClient:
client_example.dart
import 'package:snapit_sdk/snapit_sdk.dart';
final client = SnapITClient(
apiKey: "smd_live_your_key_here",
userId: "user_abc123",
);