> For the complete documentation index, see [llms.txt](https://govplane.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://govplane.gitbook.io/docs/documentation/getting-started/quickstart-1/node.js.md).

# Node.js

{% hint style="warning" %}
Before proceeding with these steps, read the initial steps of the quick start guide here [Quickstart](/docs/documentation/getting-started/quickstart-1.md)
{% endhint %}

### 1. Install the Runtime SDK

In your Node.js project, install the Govplane Runtime SDK:

```bash
npm install @govplane/runtime-sdk
```

{% hint style="info" %}
For more information and other SDKs, please review the instructions in the [SDK Overview section.](broken://pages/u81NXUCMwtvlj6ZhfKNf)
{% endhint %}

***

### 2. Initialize the Govplane Client

Initialize the client using your Runtime Key:

```typescript
//JavaScript
import { GovplaneClient } from "@govplane/runtime-sdk";

const client = new RuntimeClient({
  baseUrl:    "<YOUR-RUNTIME-ENDPOINT>",
  runtimeKey: "<YOUR-RUNTIME-KEY>",
});

await client.warmStart();           // block until the first bundle is cached
client.start();                     // start background polling
```

Make sure your `GOVPLANE_RUNTIME_KEY` is securely stored as an environment variable.

For other SDKs, please review the instructions in the [SDK Overview section.](broken://pages/u81NXUCMwtvlj6ZhfKNf)

***

### 3. Implement Your First Policy Evaluation

You can now evaluate your policy from your application:

```typescript
//JavaScript
const result = await client.evaluate({
  target:  { service: "api-gateway", resource: req.route?.path || "*", action: "request" },
  context: { method: req.method, path: req.path },
});

console.log(result);
```

The evaluation response will contain the final effect (Allow/Deny) and additional metadata if applicable.

***

### 4. Run and Verify

Start your Node.js application and:

* Trigger your evaluation logic
* Check your logs
* Confirm the returned effect matches your expected outcome

If everything is working correctly, your first Govplane-powered governance plane is live.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://govplane.gitbook.io/docs/documentation/getting-started/quickstart-1/node.js.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
