You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/api-platform/get-started/apigee-feature-summary). info

You can host your [Node.js](https://nodejs.org/en/about/) APIs on Apigee Edge, where
API proxies can call them as target services.

Node.js support on Apigee Edge allows you to build customized
backend services for your proxies in Node.js. Essentially, Apigee Edge hosts your Node.js code in
a runtime environment that is scoped to an Apigee organization and environment.
API proxies that are deployed to the same organization and environment can call
HTTP-based APIs exposed by the Node.js application.

## Node.js deployment options

Apigee provides two options for hosting Node.js code: [Hosted Targets](https://docs.apigee.com/api-platform/nodejs/node-overview#about_hosted_targets_deployment)
and the [traditional Node.js Edge deployment environment](https://docs.apigee.com/api-platform/nodejs/node-overview#about_traditional_nodejs_edge_deployment).

### Deploy to Hosted Targets

[Hosted Targets](https://docs.apigee.com/api-platform/hosted-targets/hosted-targets-overview) allows Node.js
applications to run in a native environment that does not depend on any Apigee-specific
run-time technology. It provides you a native node runtime, so you can use your
favorite node packages.

You can debug and test your app locally before deploying it
and be assured that the deployed version will work exactly as it does locally. At
deployment time, you can choose any application runtime version for running your
application in Hosted Targets. For example, you might specifically choose to run a
Node.js app in a v8.10.0 environment or any other version.

The following figure illustrates the basic architecture:

![](https://docs.apigee.com/static/api-platform/images/nodejs-hosted-targets-overview.png)

The Hosted Targets runtime environment is scoped to an Apigee organization and
environment and can serve as the target for any API proxies that are deployed to
that same organization and environment.

### Deploy to the traditional embedded Node.js environment


> [!WARNING]
> **Private Cloud Deprecation Notice:**
>
> **Support for [Node.js](https://docs.apigee.com/api-platform/nodejs/overview-nodejs-apigee-edge) proxies
> and [secure vaults](https://docs.apigee.com/api-platform/nodejs/using-secure-store)**
>
> Since 2013, Apigee has supported the
> [use of Node.js proxies within Apigee
> Edge](https://www.programmableweb.com/news/apigee-api-platform-now-supports-node.js-allowing-developers-to-build-highly-customized-apis-and-apps/brief/2013/10/25) through the use of [Trireme](https://github.com/apigee/trireme), which enables you to run your Node.js code
> within Apigee Edge for Private Cloud and expose it as an API.
>
>
> Apigee recommends Private Cloud customers take the following steps:
>
> - Migrate data in secure vaults to [Encrypted Key Value Maps](https://docs.apigee.com/api-platform/cache/key-value-maps#aboutencrypted) (KVM) to access sensitive data from an API proxy.
> - Migrate Trireme (Node.js) based API proxies to a native Node.js environment outside of Apigee.
>
>
> See also [Apigee deprecations and retirements](https://docs.apigee.com/release/deprecated-features).

> [!WARNING]
> **Public Cloud Retired feature:** The traditional, Trireme-based
> Node.js support on Apigee Edge Cloud is retired and, by extension,
> [apigee-access](https://docs.apigee.com/api-platform/nodejs/using-apigee-access) is also
> retired because it is only used in Trireme-based Node.js applications deployed on Apigee Edge.
> Trireme-based Node.js was retired on October 10, 2019. See
> [Trireme-based Node.js End of Life](https://docs.apigee.com/release/notes/trireme-nodejs-eol).

<br />

The [traditional approach to deploying Node.js to Edge](https://docs.apigee.com/api-platform/nodejs/overview-nodejs-apigee-edge)
relies internally on an open-source bridge application called ([Trireme](https://github.com/apigee/trireme))
and a JavaScript interpreter called ([Rhino](https://en.wikipedia.org/wiki/Rhino_(JavaScript_engine))).
These components allow Node.js code to execute directly in the Edge Java runtime
environment.

![](https://docs.apigee.com/static/api-platform/images/nodejs-edge-overview.png)

The traditional, embedded Node.js runtime environment is scoped to an Apigee organization and
environment and can serve as the target for any API proxies that are deployed to
that same organization and environment.

With this approach, you can use a supporting
module called [apigee-access](https://docs.apigee.com/api-platform/nodejs/using-apigee-access) that lets you access API proxy flow variables, caches,
key value maps, and quotas from within your Node.js application code.

## Choosing a Node.js approach

Apigee recommends that you consider using Hosted Targets. Node.js apps
deployed to Hosted Targets do not depend on any Apigee-specific Node.js run-time
technology. Your Node.js app will run in Hosted Targets exactly as it runs in your
local development environment.

Furthermore, Apigee support for the traditional Node.js Edge deployment is has limitations:

- Only an older version of Node.js (0.10.32) is supported.
- There are subtle differences in behavior between the standard Node.js environment and the Trireme/Rhino environment.
- Debugging Node.js apps after they are deployed to Edge is difficult.

Currently, Hosted Targets does not support the use of [apigee-access](https://docs.apigee.com/api-platform/nodejs/using-apigee-access) to access resources in the proxy flow context, such as flow variables.

To learn more about traditional Node.js Edge deployment, see
[Traditional Node.js deployment on Edge](https://docs.apigee.com/api-platform/nodejs/overview-nodejs-apigee-edge).

## Use cases

Common use cases for Node.js on Edge include:

- Building highly customized standalone HTTP-based APIs and backend services.

- Solving complex and mobile optimization problems with the advantage of a scriptable
  target endpoint.

- Building composite services and mashups.

- Rapidly developing prototypes of new APIs using frameworks like [Express](https://expressjs.com/).

## Next step

To decide which Node.js deployment approach is best for you, read the overviews:

- [Hosted Targets overview](https://docs.apigee.com/api-platform/hosted-targets/hosted-targets-overview).
- [Traditional Node.js deployment on Edge overview](https://docs.apigee.com/api-platform/nodejs/overview-nodejs-apigee-edge).