Initialization
To initialize the SDK you have to create a token through the dashboard.
Click on the settings icon on the top-right and create an API Key specifying the permissions.
Then, in your main.dart initialize the MBManager with the token created, here's an example:
1
void main() {
2
runApp(MyApp());
3
}
4
โ€‹
5
class MyApp extends StatefulWidget {
6
@override
7
_MyAppState createState() => _MyAppState();
8
}
9
โ€‹
10
class _MyAppState extends State<MyApp> {
11
@override
12
void initState() {
13
MBManager.shared.apiToken = "YOUR_API_TOKEN";
14
โ€‹
15
super.initState();
16
}
17
}
Copied!
All the functions to retrive objects are in the MBManager singleton, are async functions and retuns Future objects.
If there is an error during the request the SDK will raise a MBException with the status code and message of the error.
Last modified 1yr ago
Copy link