# Installation

## 1. Add Your API Key Meta Tag

Add the following meta tag to the `<head>` of your HTML file. This is **required** for the SDK to authenticate with the play.fun API. The value is your **creator API key** from the play.fun developer dashboard.

```html
<meta name="x-ogp-key" content="your-api-key" />
```

## 2. Add the SDK Script

Add the following script tag to your HTML file, after the meta tag:

```html
<script src="https://sdk.play.fun"></script>
```

This loads the `OpenGameSDK` into the global window.

## Full Example

```html
<!DOCTYPE html>
<html>
  <head>
    <meta name="x-ogp-key" content="your-api-key" />
    <script src="https://sdk.play.fun"></script>
  </head>
  <body>
    <script>
      const sdk = new OpenGameSDK({ ui: { usePointsWidget: true } });
      sdk.init({ gameId: 'your-game-id' }).then(() => {
        console.log('SDK ready');
      });
    </script>
  </body>
</html>
```

{% hint style="warning" %}
The `x-ogp-key` meta tag must be present in your HTML `<head>` before the SDK initializes. Without it, all API calls will fail with authentication errors. You can alternatively pass the key as `apiKey` in the SDK constructor, but the meta tag approach is recommended.
{% endhint %}
