Aller au contenu principal

Common

Methods

getKapsuleInfos() Updated

Collect current kapsule informations.

  • Name
  • Description
  • Icon path
  • Thumbnail path
  • Language
  • Activity Config
const infos = getKapsuleInfos();

Type:

  • infos: { name: string; description: string; icon: string; thumbnail: string, language: 'fr' | 'en', activityConfig: object }

importFiles(multiple: boolean, fileExtensions: string[])

Open the k-hubs modal to select the user's files and return the file path when selected.

getConfigFilesPath() Deprecated

Return the path of the folder linked to current capsule configuration.

// Assume that your kapsule has 1 config file named 'config.json'

const path = await getConfigFilesPath();

// Fetch config.json path
const res = await fetch(path + "/config.json");
const json = await res.json();

console.log(json); // Output: <Kapsule JSON config>

Type:

  • path: String