> ## Documentation Index
> Fetch the complete documentation index at: https://creator-a1160a86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started with AMM SDK

This guide will walk you through setting up a new TypeScript project to interact with the Saros AMM SDK.

## Project Setup

First, let's create a new project directory and initialize it with npm.

```bash theme={null}
mkdir my-saros-app
cd my-saros-app
npm init -y
```

This will create a `package.json` file.

## TypeScript Configuration

Next, let's install TypeScript and initialize a `tsconfig.json` file.

```bash theme={null}
npm install typescript --save-dev
npx tsc --init
```

Now, replace the contents of the generated `tsconfig.json` with the following configuration. This sets up the project to work correctly with the Saros SDK, which is written in JavaScript.

Key settings to note are `"allowJs": true` and `"esModuleInterop": true` to ensure compatibility, and `"outDir": "./dist"` to keep our compiled files organized.

```json tsconfig.json expandable theme={null}
{
  // Visit https://aka.ms/tsconfig to read more about this file
  "compilerOptions": {
    // File Layout
    // "rootDir": "./src",
    "outDir": "./dist",

    // Environment Settings
    // See also https://aka.ms/tsconfig/module
    "module": "nodenext",
    "target": "esnext",
    "types": [],
    "typeRoots": ["./node_modules/@types", "./types"],
    // For nodejs:
    // "lib": ["esnext"],
    // "types": ["node"],
    // and npm install -D @types/node

    // Other Outputs
    "sourceMap": true,
    "declaration": true,
    "declarationMap": true,

    // Stricter Typechecking Options
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,

    // Style Options
    // "noImplicitReturns": true,
    // "noImplicitOverride": true,
    // "noUnusedLocals": true,
    // "noUnusedParameters": true,
    // "noFallthroughCasesInSwitch": true,
    // "noPropertyAccessFromIndexSignature": true,

    // Recommended Options
    "strict": true,
    "jsx": "react-jsx",
    "verbatimModuleSyntax": true,
    "isolatedModules": true,
    "noUncheckedSideEffectImports": true,
    "moduleDetection": "force",
    "skipLibCheck": true,
    "allowJs": true,
    "esModuleInterop": true
  }
}
```

## Update `package.json`

To use ES modules, which is the standard for modern JavaScript, you need to add `"type": "module"` to your `package.json`.

Here's how the `package.json` should look after the change.

```json package.json icon="code" lines theme={null}
  "name": "my-saros-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module", // [!code ++]
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
```

## Install Saros SDK

Finally, install the `@saros-finance/sdk`. You can use either `npm` or `yarn`.

```shellscript npm theme={null}
npm install @saros-finance/sdk
```

```shellscript yarn theme={null}
yarn add @saros-finance/sdk
```

Now you are all set up to start building with the Saros AMM SDK!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.