# FAQ

{% stepper %}
{% step %}

### <mark style="color:blue;">General</mark>

#### What is the YieldFi SDK?

The YieldFi SDK is a TypeScript/JavaScript library for interacting with YieldFi services, smart contracts, and blockchain protocols.

#### What version of Node.js do I need?

Node.js 18.0.0 or higher is required.

#### Do I need TypeScript?

No, but TypeScript is recommended for the best developer experience. The SDK is written in TypeScript and provides full type definitions.
{% endstep %}

{% step %}

### <mark style="color:blue;">Authentication</mark>

#### How do I authenticate users?

Users authenticate using EVM wallet signatures. See the Wallet Authentication Guide.

#### Where are tokens stored?

The SDK does not store tokens internally. You must manage token storage in your application (localStorage, sessionStorage, HTTP-only cookies, etc.).

#### How do I refresh tokens?

Use the `refresh()` method with a refresh token. See Token Management.

#### What happens when a token expires?

When an access token expires, use the refresh token to get a new one. If the refresh token is also expired, the user needs to login again.
{% endstep %}

{% step %}

### <mark style="color:blue;">API Usage</mark>

#### Which APIs require authentication?

Most transaction endpoints, Glassbook, Forms, and Curator Handoff APIs require authentication. Most vault query endpoints are public. See API Reference Overview.

#### How does role-based filtering work?

Regular users automatically see only their own transactions. Admins, moderators, managers, and LPs can see all transactions. See Vault API - Transactions.

#### How do I handle pagination?

Most list endpoints support pagination with `page` and `pageSize` parameters. See individual API documentation for details.
{% endstep %}

{% step %}

### <mark style="color:blue;">Contract Interactions</mark>

#### How do I get contract ABIs?

Contract ABIs are not included in the SDK. You can get them from:

* Official YieldFi documentation
* Block explorers (Etherscan, Arbiscan, etc.)
* Contract source code repositories

#### Can I use the SDK without ethers.js?

The SDK provides TypeScript types for contract interactions, but you'll need ethers.js (or another compatible library) for actual contract calls.
{% endstep %}

{% step %}

### <mark style="color:blue;">Errors</mark>

#### How do I handle errors?

Use try-catch blocks and check error types. See Error Handling.

#### What's the difference between AuthenticationError and NetworkError?

* `AuthenticationError`: Invalid credentials, expired tokens, malformed JWTs
* `NetworkError`: Network issues, timeouts, HTTP errors
  {% endstep %}

{% step %}

### <mark style="color:blue;">Support</mark>

#### Where can I get help?

* 📖 Documentation
* 💬 [Discord Community](https://discord.gg/yieldfi)
* 🐛 [GitHub Issues](https://github.com/yieldfi/yieldfi-sdk/issues)

#### How do I report a bug?

Open an issue on [GitHub](https://github.com/yieldfi/yieldfi-sdk/issues) with:

* SDK version
* Node.js version
* Steps to reproduce
* Error messages
* Code example (if applicable)
  {% endstep %}
  {% endstepper %}


---

# 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.yield.fi/earn-with-yieldfi/integration-sdk/faq.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.
