---
schema_version: "1"
id: cb0e7991e98de7b918ae4953bf313af55128d0f3532af17fe7e88d51081aa51b
title: $A namespace
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-dollara.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 771f36dee64e8aa1159afe0274395ad26fad295279b0f4b19c88f6c7ffd6ce47
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# $A namespace

The `$A` namespace is the entry point for using the framework in JavaScript code.

## Methods

-   **[createComponent()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-createcomponent.md)**  


    Create a component from a type and a set of attributes. This method accepts the name of a type of component, a map of attributes, and a callback to notify the caller.

-   **[createComponents()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-createcomponents.md)**  


    Create an array of components from a list of types and attributes. This method accepts a list of component names and attribute maps, and a callback to notify the caller.

-   **[enqueueAction()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-enqueueaction.md)**  


    Queue a call to an Apex action . The framework queues up actions before sending them to the server. This mechanism is largely transparent to you when you’re writing code but it enables the framework to minimize network traffic by batching multiple actions into one request (XHR).

-   **[error()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-error.md)**  


    Deprecated. For a serious error that has no recovery path, throw a standard JavaScript error instead by using `throw new Error(msg)`.

-   **[get()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-get.md)**  


    Returns a value from the specified global value provider using property syntax.

-   **[getCallback()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-getcallback.md)**  


    Use `$A.getCallback()` to wrap any code that modifies a component outside the normal rerendering lifecycle, such as in a `setTimeout()` call. The `$A.getCallback()` call ensures that the framework rerenders the modified component and processes any enqueued actions.

-   **[getComponent()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-getcomponent.md)**  


    Gets an instance of a component from either a global ID or a DOM element that was created by a rendered component.

-   **[getReference()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-getreference.md)**  


    Returns a live reference to the global value requested using property syntax.

-   **[getRoot()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-getroot.md)**  


    Gets the root component or application. For example, `$A.getRoot().get("v.attrName")` returns the value of the `attrName` attribute from the root component.

-   **[getToken()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-gettoken.md)**  


    Returns an application configuration token referenced by name. A tokens file is configured with the `tokens` attribute in the `<aura:application>` tag.

-   **[log()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-log.md)**  


    Deprecated. Logs to the browser's JavaScript console, if it is available. This method doesn't log in production or debug modes so it’s only useful for internal usage by the framework.

-   **[reportError()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-reporterror.md)**  


    Report an error to the server after handling it. Note that the method should be used only if the try-catch mechanism of error handling is not desired or not functional, such as in nested promises.

-   **[run()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-run.md)**  


    Deprecated. Use `getCallback()` instead.

-   **[set()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-set.md)**  


    Sets a value on the specified global value provider using property syntax.

-   **[warning()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-warning.md)**  


    Deprecated. Logs a warning to the browser's JavaScript console, if it is available.


