Create an Api instance as an entrypoint to all data. The connectLocal method must be called to connect to the database.

Constructor

@:keepnew (?config:ApiConfig)

Variables

@:keepread onlyconfig:ApiConfig

@:value([])@:keepread onlypreviews:Array<EntryVersion> = []

Methods

@:keepconnect (config:MainConfig):Api

@:keepconnectLocal ():Api

Connect to the database using the local json config file.

@:keepgetBackend ():BackendApi

Returns a BackendApi instance

Use the backend to modify content, users or roles.

See BackendApi for more info.

@:keepgetFrontend (projectKey:String, ?language:String):FrontendApi

Returns a FrontendApi instance for a given project key and language.

Use a site to display content.

See FrontendApi for more info.

@:keepperformQuery (query:String):Void

@:keeppreview (hash:String):Void

Set preview information.

@:keepsetSorting (projectKey:String, channel:String, keys:Array<SortKey>):Void

Set the sorting order for a certain channel. This will set the order for all languages in the project. In order to use this functionality you need to define an index in the CMS for this channel/key.