# Read

#### Initialize Subs Client

```typescript
import { SubsSDK, PaymentType, PeriodType, SubsPayment, Keypair } from 'subs-sdk';

// Initialize with wallet private key (keep this secure!)
const subsClient = new SubsSDK("YOUR_WALLET_PRIVATE_KEY", "testnet"); // "testnet" or "mainnet"
```

### Get Payments IDs

```typescript
await subsClient.get_app_payments(
  appId,        // BigInt
);
```

It will return the list of Payments ID in side one particular App.

### Get User Subscriptions

```typescript
await subsClient.get_user_subscriptions(
  userAdress,        // String
);
```

It will return a list of Subscription IDs for one particular User.

### Get Subscription

```typescript
await subsClient.get_subscription(
  subsId,        // String
);
```

It will give you all the data concerning a particular Subscription.

### Get App Subscribers

```rust
await subsClient.get_app_subscribers(
  appId,        // BigInt
  paymentId,    // String
);
```

It will return a list of User subscribed to a particular Payment of an App.

### Get App Subscriptions

```rust
await subsClient.get_app_subscriptions(
  appId,        // BigInt
);
```

It will return a list of Subscription IDs for a particular App.

### Get Already Subscribed

```rust
await subsClient.get_already_subscribed(
  appId,        // BigInt
  user,         // String
);
```

It will return a boolean if the User is subscribed to an App.&#x20;

### Get Canceled Subscription

```rust
await subsClient.get_cancel_subscription(
  subs_id,      // String
);
```

It will give you a boolean if the User has canceled his Subscription.


---

# Agent Instructions: 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:

```
GET https://docs.subsprotocol.com/developer-docs/subs-sdk/read.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
