> For the complete documentation index, see [llms.txt](https://docs.clique.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clique.tech/toolchain/clique-attestation-sdk/reading-attestations-off-chain.md).

# Reading Attestations Off-Chain

This step-by-step guide will run you through programatically reading attestations offchain using Typescript SDKs for EAS and Verax protocols.

### Verax

Find the full Verax SDK documentation [here](https://docs.ver.ax/verax-documentation/developer-guides/using-the-sdk).

Start by installing the Verax SDK package.

```sh
# npm
npm i --save @verax-attestation-registry/verax-sdk
```

Next create a typescript file in a node project and paste the following code.

```typescript
// ES6
import { VeraxSdk } from "@verax-attestation-registry/verax-sdk";

const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_TESTNET_FRONTEND);

const attestationDataMapper = veraxSdk.attestation; // RW Attestations

const myAttestation = await attestationDataMapper.findOneById("0x000000000000000000000000000000000000000000000000000000000000109b");

// args:
// 	- criteria: object {property1: value1, property2: value2, ...}
// 	- page: integer (optional, default 0)
// 	- offset: integer (optional, default 50, max= 500)
// 	- orderBy: string (optional, default createdAt)
// 	- order(property?): enum string "ASC", "DESC" (optional, default "DESC")
//
const myAttestations = await attestationDataMapper.findBy(
  { portalId: "37773", subject: "John" },
  4,
  30,
  "schemaId",
  "ASC",
);

console.log(myAttestations);
```

### EAS

Find the full EAS SDK documentation [here](https://docs.attest.sh/docs/developer-tools/eas-sdk).

Start by installing the EAS SDK package.

```typescript
npm install @ethereum-attestation-service/eas-sdk
```

Next create a typescript file and paste in the following code

```typescript
import { EAS } from "@ethereum-attestation-service/eas-sdk";
import { EAS, Offchain, SchemaEncoder, SchemaRegistry } from "@ethereum-attestation-service/eas-sdk";
import { ethers } from 'ethers';

export const EASContractAddress = "0xC2679fBD37d54388Ce493F1DB75320D236e1815e"; // Sepolia v0.26

// Initialize the sdk with the address of the EAS Schema contract address
const eas = new EAS(EASContractAddress);

// Gets a default provider (in production use something else like infura/alchemy)
const provider = ethers.providers.getDefaultProvider(
  "sepolia"
);

// Connects an ethers style provider/signingProvider to perform read/write functions.
// MUST be a signer to do write operations!
eas.connect(provider);

// The UID of the attestation we want to fetch
const uid = "0xff08bbf3d3e6e0992fc70ab9b9370416be59e87897c3d42b20549901d2cccc3e";

const attestation = await eas.getAttestation(uid);

console.log(attestation);
```

###


---

# 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://docs.clique.tech/toolchain/clique-attestation-sdk/reading-attestations-off-chain.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.
