Search.../

getPackageConfig( )

Retrieves the value of a specific key in a package's config.json file.

Description

The getPackageConfig() function returns a Promise that resolves to the value of a key in a package's config.json file.

When you build a Velo package, you can include a config.json file. Users of the package can edit this file and add personalized information such as settings preferences. The getPackageConfig() function allows you to access the contents of the config.json file in your package code.

Syntax

function getPackageConfig(key: string): Promise<*>

getPackageConfig Parameters

NAME
TYPE
DESCRIPTION
key
string

The config.json key whose value you want to retrieve.

Returns

Fulfilled - The value of the requested key.

Return Type:

Promise<*>

Was this helpful?

Retreive a user's ID number from a package's config.json file

Copy Code
1import { getPackageConfig } from 'wix-configs-backend';
2
3// ...
4
5const userId = getPackageConfig('id');
6