# Integration - step 2

escs is plugin based. We are providing plugins for different game engines and all you have to do is to integrate our plugin.

## Connect plugin to the project.

Locate plugin for your game engine in the menu on the left and follow instructions there on how to download and connect it to your project.

{% hint style="info" %}
If you do not see a plugin for your game engine, please write us a message. We are constantly developing new plugins and are happy to help you.
{% endhint %}

Here you will find generic description on how to integrate plugins. For specific instructions go to the instructions for your game engine on the left.

## Set up the plugin.

For the escs to work properly with your game you need to do 3 simple things:&#x20;

* initialize the system at the start of your game (after that all the socialization features are immediately available)
* let the escs know when the user starts an actual game or start the game when escs let's you know about that.
* let the escs know when the user ends the game and sends the user's score to the escs.

At the start of your game, as early as possible, call the method `invokeManaged()` of the plugin. Invoke takes public key from step 1 as a parameter, which you must submit (this is example for JS/ReactNative plugin, please refer to appropriate plugin section for config parameters):

```
service.invokeManaged({
    public_key: '3dd48bec-2e82-4826-8757-fc14d872882d',
    base_url: 'https://api.escs.io',
    player_base_url: 'https://37b35a72-f8d9-48ca-8cd1-e6690c23637c.player.escs.io',
    analyticsEnv: 'stage'
})
```

When a user starts an actual game, just before the game starts, call method `startGame()` or register a callback as described in your plugin section .

```
service.startGame()
```

When the game ends, call the method `endGame(points)` - instead of points send an actual score that the user got in the game.

```
service.endGame(1378)
```

{% hint style="info" %}
You can define units for the score and more in the client.escs.io.&#x20;
{% endhint %}

This completes the basic integration. \
Now when you start your game, you'll find an escs symbol inside it and all the services that escs has to offer.

Where to go from here, besides the description of the specific instructions for your plugin? \
Read about the tournament series [here](https://docs.escs.io/tournament-series/your-first-tournament-series).


---

# 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.escs.io/integration-step-2.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.
