init method

Initialize SDK.

This method must be called before using any other method.

It returns DirectusCore object in which this method is called. This way simply chaining is possible without using ..init(). For example:

sdk = await Directus(url).init();

Implementation

Future<DirectusCore> init() async {
  if (_isInitialized) return this;

  await auth.init();
  _isInitialized = true;

  return this;
}