# Class: `Settings` [@jupyterlite/settings](../modules/jupyterlite_settings.md).Settings A class to handle requests to /api/settings ## Implements - [`ISettings`](../modules/jupyterlite_settings.md#isettings) ## Constructors ### `constructor` > > **`new Settings`**(`options`) #### Parameters | Name | Type | | :------ | :------ | | `options` | [`IOptions`](../interfaces/jupyterlite_settings.Settings.IOptions.md) | #### Defined in [packages/settings/src/settings.ts:20](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L20) ## Properties ### `_localforage` > > `Private` **`_localforage`**: `LocalForage` #### Defined in [packages/settings/src/settings.ts:152](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L152) ### `_ready` > > `Private` **`_ready`**: `PromiseDelegate`<`void`\> #### Defined in [packages/settings/src/settings.ts:153](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L153) ### `_storage` > > `Private` **`_storage`**: `undefined` \| `LocalForage` #### Defined in [packages/settings/src/settings.ts:151](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L151) ### `_storageDrivers` > > `Private` **`_storageDrivers`**: ``null`` \| `string`[] = `null` #### Defined in [packages/settings/src/settings.ts:150](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L150) ### `_storageName` > > `Private` **`_storageName`**: `string` = `DEFAULT_STORAGE_NAME` #### Defined in [packages/settings/src/settings.ts:149](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L149) ## Accessors ### `defaultStorageOptions` > > `Protected` `get` **`defaultStorageOptions`**(): `LocalForageOptions` Get default options for localForage instances #### Returns `LocalForageOptions` #### Defined in [packages/settings/src/settings.ts:60](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L60) ### `ready` > > `get` **`ready`**(): `Promise`<`void`\> A promise that resolves when the settings storage is fully initialized #### Returns `Promise`<`void`\> #### Implementation of ISettings.ready #### Defined in [packages/settings/src/settings.ts:31](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L31) ### `storage` > > `Protected` `get` **`storage`**(): `Promise`<`LocalForage`\> A lazy reference to initialized storage #### Returns `Promise`<`LocalForage`\> #### Defined in [packages/settings/src/settings.ts:38](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L38) ## Methods ### `_getAll` > > `Private` **`_getAll`**(`file`): `Promise`<[`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)[]\> Get all the settings for core or federated plugins #### Parameters | Name | Type | | :------ | :------ | | `file` | [`SettingsFile`](../modules/jupyterlite_settings.md#settingsfile) | #### Returns `Promise`<[`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)[]\> #### Defined in [packages/settings/src/settings.ts:141](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L141) ### `defaultSettingsStorage` > > `Protected` **`defaultSettingsStorage`**(): `LocalForage` Create a settings store. #### Returns `LocalForage` #### Defined in [packages/settings/src/settings.ts:72](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L72) ### `get` > > **`get`**(`pluginId`): `Promise`<`undefined` \| [`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)\> Get settings by plugin id #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `pluginId` | `string` | the id of the plugin | #### Returns `Promise`<`undefined` \| [`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)\> #### Implementation of ISettings.get #### Defined in [packages/settings/src/settings.ts:86](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L86) ### `getAll` > > **`getAll`**(): `Promise`<{ `settings`: [`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)[] }\> Get all the settings #### Returns `Promise`<{ `settings`: [`IPlugin`](../interfaces/jupyterlite_settings.IPlugin.md)[] }\> #### Implementation of ISettings.getAll #### Defined in [packages/settings/src/settings.ts:98](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L98) ### `initStorage` > > `Protected` **`initStorage`**(): `Promise`<`void`\> Prepare the storage #### Returns `Promise`<`void`\> #### Defined in [packages/settings/src/settings.ts:53](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L53) ### `initialize` > > **`initialize`**(): `Promise`<`void`\> Finish any initialization after server has started and all extensions are applied. #### Returns `Promise`<`void`\> #### Defined in [packages/settings/src/settings.ts:45](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L45) ### `save` > > **`save`**(`pluginId`, `raw`): `Promise`<`void`\> Save settings for a given plugin id #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `pluginId` | `string` | The id of the plugin | | `raw` | `string` | The raw settings | #### Returns `Promise`<`void`\> #### Implementation of ISettings.save #### Defined in [packages/settings/src/settings.ts:134](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/settings/src/settings.ts#L134)