clients/client-appconfig/README.md
AWS SDK for JavaScript AppConfig Client for Node.js, Browser and React Native.
<p>AppConfig helps you safely change application behavior in production without redeploying code. Using feature flags and dynamic free-form configurations, you can control how your application runs in real time. This approach reduces risk, accelerates releases, and enables faster responses to issues. You can gradually roll out new features to specific users, monitor their impact, and expand availability with confidence. You can also update block lists, allow lists, throttling limits, and logging levels instantly, allowing you to mitigate issues and fine-tune performance without a deployment.</p> <p>AppConfig supports a broad spectrum of use cases:</p> <ul> <li> <p> <b>Feature flags and toggles</b> – Gradually release new capabilities to targeted users, monitor impact, and instantly roll back changes if issues occur.</p> </li> <li> <p> <b>Application tuning</b> – Introduce changes safely in production, measure their effects, and refine behavior without redeploying code.</p> </li> <li> <p> <b>Allow list or block list</b> – Control access to features or restrict specific users in real time, without modifying application code. </p> </li> <li> <p> <b>Centralized configuration storage</b> – Manage configuration data consistently across workloads. AppConfig can deploy configuration from the AppConfig hosted configuration store, Secrets Manager, Systems Manager, Systems Manager Parameter Store, or Amazon S3.</p> </li> </ul> <p> <b>How AppConfig works</b> </p> <p>This section provides a high-level description of how AppConfig works and how you get started.</p> <dl> <dt>1. Identify configuration data to manage in AppConfig</dt> <dd> <p>Before creating a configuration profile, identify the configuration data in your code that you want to manage dynamically using AppConfig. Common examples include feature flags, allow and block lists, logging levels, service limits, and throttling rules. These values tend to change frequently and can cause issues if misconfigured.</p> <p>If your configuration data already exists in cloud services such as Systems Manager Parameter Store or Amazon S3, you can use AppConfig to validate, deploy, and manage that data more effectively.</p> </dd> <dt>2. Create a configuration profile in AppConfig</dt> <dd> <p>A configuration profile defines how AppConfig locates and manages your configuration data. It includes a URI that points to the data source and a profile type.</p> <p>AppConfig supports two profile types</p> <ul> <li> <p> <b>Feature flags</b> – Enable controlled feature releases, gradual rollouts, and testing in production.</p> </li> <li> <p> <b>Free-form configurations</b> – Store and retrieve configuration data from external sources and update it without redeploying code.</p> </li> </ul> <p>Both profile types help decouple configuration from code, support continuous delivery, and reduce deployment risk.</p> <p>You can also add optional validators to ensure that configuration data is syntactically and semantically correct. During deployment, AppConfig evaluates these validators and automatically rolls back changes if validation fails.</p> <p>Each configuration profile is associated with an application, which acts as a logical container for your configuration resources. For more information about creating a configuration profile, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-profile.html">Creating a configuration profile in AppConfig</a> in the the <i>AppConfig User Guide</i>.</p> </dd> <dt>3. Deploy configuration data</dt> <dd> <p>When you start a deployment, AppConfig:</p> <ol> <li> <p>Retrieves configuration data from the source defined in the configuration profile</p> </li> <li> <p>Validates the data using the configured validators</p> </li> <li> <p>Delivers the validated configuration to AppConfig Agent</p> </li> </ol> <p>The delivered configuration becomes the deployed version used by your application. For more information about deploying a configuration, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/deploying-feature-flags.html">Deploying feature flags and configuration data in AppConfig</a>.</p> </dd> <dt>4. Retrieve configuration data</dt> <dd> <p>Your application retrieves configuration data by calling a local endpoint exposed by AppConfig Agent, which caches the deployed configuration. Retrieving data is a metered event. AppConfig Agent supports a variety of use cases, as described in <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-agent-how-to-use.html">How to use AppConfig Agent to retrieve configuration data</a>.</p> <p>If the agent is not suitable for your use case, your application can retrieve configuration data directly from AppConfig by calling the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html">GetLatestConfiguration</a> API actions. </p> <p>For more information about retrieving a configuration, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and configuration data in AppConfig</a>.</p> </dd> </dl> <p>This reference is intended to be used with the <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html">AppConfig User Guide</a>.</p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-appconfigyarn add @aws-sdk/client-appconfigpnpm add @aws-sdk/client-appconfigThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the AppConfigClient and
the commands you need, for example ListApplicationsCommand:
// ES5 example
const { AppConfigClient, ListApplicationsCommand } = require("@aws-sdk/client-appconfig");
// ES6+ example
import { AppConfigClient, ListApplicationsCommand } from "@aws-sdk/client-appconfig";
To send a request:
send operation on the client, providing the command object as input.const client = new AppConfigClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListApplicationsCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
AppConfig extends AppConfigClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (AppConfigClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { AppConfig } from "@aws-sdk/client-appconfig";
const client = new AppConfig({ region: "REGION" });
// async/await.
try {
const data = await client.listApplications(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listApplications(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listApplications(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-appconfig package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> CreateConfigurationProfile </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDeploymentStrategy </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateEnvironment </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateExperimentDefinition </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateExtension </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateExtensionAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateHostedConfigurationVersion </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteConfigurationProfile </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDeploymentStrategy </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteEnvironment </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteExperimentDefinition </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteExtension </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteExtensionAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteHostedConfigurationVersion </summary>Command API Reference / Input / Output
</details> <details> <summary> GetAccountSettings </summary>Command API Reference / Input / Output
</details> <details> <summary> GetApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> GetConfiguration </summary>Command API Reference / Input / Output
</details> <details> <summary> GetConfigurationProfile </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDeployment </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDeploymentStrategy </summary>Command API Reference / Input / Output
</details> <details> <summary> GetEnvironment </summary>Command API Reference / Input / Output
</details> <details> <summary> GetExperimentDefinition </summary>Command API Reference / Input / Output
</details> <details> <summary> GetExperimentRun </summary>Command API Reference / Input / Output
</details> <details> <summary> GetExtension </summary>Command API Reference / Input / Output
</details> <details> <summary> GetExtensionAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> GetHostedConfigurationVersion </summary>Command API Reference / Input / Output
</details> <details> <summary> ListApplications </summary>Command API Reference / Input / Output
</details> <details> <summary> ListConfigurationProfiles </summary>Command API Reference / Input / Output
</details> <details> <summary> ListDeployments </summary>Command API Reference / Input / Output
</details> <details> <summary> ListDeploymentStrategies </summary>Command API Reference / Input / Output
</details> <details> <summary> ListEnvironments </summary>Command API Reference / Input / Output
</details> <details> <summary> ListExperimentDefinitions </summary>Command API Reference / Input / Output
</details> <details> <summary> ListExperimentRunEvents </summary>Command API Reference / Input / Output
</details> <details> <summary> ListExperimentRuns </summary>Command API Reference / Input / Output
</details> <details> <summary> ListExtensionAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListExtensions </summary>Command API Reference / Input / Output
</details> <details> <summary> ListHostedConfigurationVersions </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> StartDeployment </summary>Command API Reference / Input / Output
</details> <details> <summary> StartExperimentRun </summary>Command API Reference / Input / Output
</details> <details> <summary> StopDeployment </summary>Command API Reference / Input / Output
</details> <details> <summary> StopExperimentRun </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UntagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateAccountSettings </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateConfigurationProfile </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateDeploymentStrategy </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateEnvironment </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateExperimentDefinition </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateExperimentRun </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateExtension </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateExtensionAssociation </summary> </details> <details> <summary> ValidateConfiguration </summary> </details>