> For the complete documentation index, see [llms.txt](https://developer.sahamati.org.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.sahamati.org.in/sahamatinet-agent-sna/integration-guide/step-by-step-integration.md).

# Step-by-Step Integration

Follow these steps to integrate your AA service with SNA. The integration is designed to be minimal.

The AA application communicates with SNA via HTTP APIs. Sahamati will share a library, snalib, that AAs can use to set up the interface with SNA and perform the API calls.

### Step 1: Deploy SNA to your cluster

Deploy the SNA Helm chart into your Kubernetes cluster. Refer to Deploying SNA for detailed deployment instructions.

### Step 2: Add snalib to your service

Include the snalib library in your AA service code. The library is available for Node, Go, and Java on Sahamati's GitHub. Refer to SNA Library (snalib) for integration steps.

### Step 3: Instrument your AA-FIP interface

#### Set up a connection with SNA

As part of the AA application initialization, call the snalib function to initialize the connection to SNA.

#### Push transaction metadata to SNA

Add snalib method calls at each of the 4 integration points (A, B, C, D) in your AA-FIP service logic:

* **Point A (requestOut):** Call snalib before sending a request to a FIP, with the required parameters.
* **Point B (responseIn):** Call snalib after receiving a response from a FIP, with the required parameters. Ensure that if a Point-A call was made to SNA, a call is made at Point-B. All cases, including client failures, server timeouts, and connection failures, need to be handled.
* **Point C (requestIn):** Call snalib when your AA service receives an incoming notification from a FIP, with the required parameters.
* **Point D (responseOut):** Call snalib after your AA service sends a response back to a FIP, with the required parameters.

> 📌 SNA is designed to be non-blocking and has minimal performance impact. All aggregation is done asynchronously inside the SNA agent. It is not done in your service.

### Step 4: Configure the SNA endpoint

Ensure your SNA deployment is configured with the correct Sahamati SLA endpoint (see Endpoints & Authentication).

### Step 5: Validate in UAT

Before deploying to Production, validate the integration in your UAT environment:

* Confirm that SNA is running and healthy in the cluster.
* Trigger a few AA-FIP API calls and verify that SNA is receiving the data.
* After 10 minutes, check with Sahamati's team to confirm that metric payloads are being received at the UAT endpoint.
* Review the response from the endpoint for any validation errors or warnings.

### Step 6: Deploy to Production

Once UAT validation is complete, deploy SNA to your Production cluster and point it at the Production SLA endpoint.


---

# 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://developer.sahamati.org.in/sahamatinet-agent-sna/integration-guide/step-by-step-integration.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.
