> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyspend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation & setup

Install the SDK, set up providers, and verify everything works

**AnySpend Setup**

## Prerequisites

**Node.js**

v20.15.0 or higher
  **React**

Version 18 or 19
  **TypeScript**

Recommended for better DX

## Installation

Choose your preferred package manager:

**npm**

```bash
    npm install @b3dotfun/sdk
    ```
  **pnpm**

```bash
    pnpm add @b3dotfun/sdk
    ```

## Basic Setup

### 1. Provider Setup

Wrap your app with the `B3Provider` and `AnyspendProvider` to enable AnySpend functionality:

```tsx App.tsx icon=react
import { AnyspendProvider } from "@b3dotfun/sdk/anyspend/react";
import { B3Provider } from "@b3dotfun/sdk/global-account/react";
import "@b3dotfun/sdk/index.css";

function App() {
  return (
    <B3Provider theme="light" environment="production" partnerId="your-awesome-partner-id">
      <AnyspendProvider>{/* Your app components */}</AnyspendProvider>
    </B3Provider>
  );
}

export default App;
```

### 2. Environment Configuration

**Mainnet**

**Endpoint**: `https://mainnet.anyspend.com`

    Use this for production applications with real transactions.
  **Testnet**

**Endpoint**: `http://testnet.anyspend.com`

    Use this for development and testing with test tokens.

    Note: Testnet is currently not available.

### 3. TypeScript Configuration (Optional but Recommended)

If you're using TypeScript, ensure your `tsconfig.json` includes these settings for optimal compatibility:

```json tsconfig.json icon=settings
{
  "compilerOptions": {
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true
  }
}
```

## Verification

Create a simple test component to verify your setup works correctly:

```tsx TestComponent.tsx icon=test-tube lines
import { AnySpend } from "@b3dotfun/sdk/anyspend/react";

function TestComponent() {
  return <AnySpend />;
}
```

## Next Steps

**[Explore Components](/anyspend/components)**

Learn about available components for different payment scenarios
  **[Learn about Hooks](/anyspend/hooks)**

Discover React hooks for building custom payment flows
  **[See Examples](/anyspend/examples)**

Browse real-world implementation examples

## Troubleshooting

**Import Errors**

Make sure you've installed the SDK correctly and imported the CSS file. The SDK requires React 18\+ and may have compatibility issues with older versions.
  **Provider Not Found**

Ensure you have `B3Provider` and `AnyspendProvider` placed high in your component tree, typically in your main App component.
  **TypeScript Errors**

If you're seeing TypeScript errors, verify your `tsconfig.json` includes the recommended settings above.