<?php
$scopes = $this->getParam('scopes', );
?>

<p>Using your API Keys, you can access Appwrite services using the SDK of your choice. To create a new API key, go to your API keys tab in your project setting using your Appwrite Console and click the 'Add API Key' button.</p>

<p>When adding a new API Key, you can choose which scope to grant your application. If you need to replace your API Key, create a new key, update your app credentials and, once ready, delete your old key.</p>

<div class="notice">
  <h2>Best Practice</h2>
  <p>It is a best practice to grant only the scopes you need to meet your project's goals to an API key. API keys should be treated as a secret. Never share the API key and keep API keys out of client applications.</p>
</div>

<h2 id="scopes">Scopes</h2>

<table class="full text-size-small">
    <thead>
    <tr>
        <td style="width: 140px">Name</td>
        <td>Description</td>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($scopes as $key => $scope):
        $description = $scope['description'] ?? '';
        ?>
    <tr>
        <td><?php echo $this->escape($key); ?></td>
        <td><?php echo $this->escape($description); ?></td>
    </tr>
    <?php endforeach; ?>
    </tbody>
</table>