> For the complete documentation index, see [llms.txt](https://fragmentdevelopment.gitbook.io/fivem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fragmentdevelopment.gitbook.io/fivem/paid-scripts/api/installation/api-ts.md). Agents can also search and read this documentation through its [MCP server](https://fragmentdevelopment.gitbook.io/fivem/~gitbook/mcp).

# API TS

### Requirements

* NodeJS: <https://nodejs.org/>
* Yarn (optional): <https://yarnpkg.com/>&#x20;

### Installation

1. Download or copy the github repository: <https://github.com/cassanodev/cs_api_ts>
2. Extract the file and drag it into any site on your PC. **DO NOT PUT IT INTO YOUR RESOURCES FOLDER.**
3. Open a console in the root of the directory and run one of these:

```bash
# yarn (if you're using yarn):
yarn install

# npm (if you're using npm (NodeJS)):
npm install
```

### Setting up API TS

1. Head to <https://discord.com/developers/applications> and log in.
2. Click the "**New Application**" button located in the right top corner.
3. Set a name for your bot, accept T\&C and click "**Create**".
4. Click the "**Installation**" button located in the left menu.
5. Scroll to the bottom of this page where it says "**Guild Install**", click next to "**applications.command**", select the "**bot**" option, **give admin permissions** and save your changes.
6. Copy the link above, open it in your browser and add the bot to your discord server.
7. Click the "**bot**" button located in the left menu.
8. Click the "Reset Token" button, copy it, and add it to the configuration file in the **discord\_bot\_token variable** in cs\_api\_ts.
9. Active the following privilege intents:&#x20;

* Presence Intent
* Server Members Intent
* Message Content Intent

#### You'll also need to set up some things to make the system safer

1. Open a CMD Window and run `node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`
2. Copy the generated key and paste it into `Config.requestConfig.authorization`&#x20;

That's it!
