PHPackages                             discord/interactions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. discord/interactions

ActiveLibrary[API Development](/categories/api)

discord/interactions
====================

Utils for implementing the Discord Interactions API

2.2.0(4y ago)46362.3k↓13.9%14[2 PRs](https://github.com/discord/discord-interactions-php/pulls)5MITPHP

Since Dec 12Pushed 2y ago10 watchersCompare

[ Source](https://github.com/discord/discord-interactions-php)[ Packagist](https://packagist.org/packages/discord/interactions)[ RSS](/packages/discord-interactions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (12)Used By (5)

discord-interactions-php
------------------------

[](#discord-interactions-php)

Types and helper functions that may come in handy when you implement a Discord Interactions webhook.

Installation
============

[](#installation)

Install from [packagist](https://packagist.org/packages/discord/interactions):

```
composer require discord/interactions

```

Validating request signatures requires the [`simplito/elliptic-php`](https://github.com/simplito/elliptic-php) package to be installed, which requires the `php-gmp` extension to be enabled:

```
composer require simplito/elliptic-php

```

Usage
=====

[](#usage)

Use `InteractionType` and `InteractionResponseType` to interpret and respond to webhooks.

Use `InteractionResponseFlags` to make your response special.

Use `verifyKey` to check a request signature. Note you must install the `simplito/elliptic-php` package first. For example:

```
use Discord\Interaction;
use Discord\InteractionResponseType;

$CLIENT_PUBLIC_KEY = getenv('CLIENT_PUBLIC_KEY');

$signature = $_SERVER['HTTP_X_SIGNATURE_ED25519'];
$timestamp = $_SERVER['HTTP_X_SIGNATURE_TIMESTAMP'];
$postData = file_get_contents('php://input');

if (Interaction::verifyKey($postData, $signature, $timestamp, $CLIENT_PUBLIC_KEY)) {
  echo json_encode(array(
    'type' => InteractionResponseType::PONG
  ));
} else {
  http_response_code(401);
  echo "Not verified";
}
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~85 days

Total

12

Last Release

1559d ago

Major Versions

1.0.8 → 2.0.02021-06-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/b46b6420a3ee2d2594b7d33eb2bf16b48d3a3484b61a9ad6eceda70343ede57b?d=identicon)[ianww](/maintainers/ianww)

---

Top Contributors

[![typpo](https://avatars.githubusercontent.com/u/310310?v=4)](https://github.com/typpo "typpo (8 commits)")[![davidcole1340](https://avatars.githubusercontent.com/u/991872?v=4)](https://github.com/davidcole1340 "davidcole1340 (3 commits)")[![SQKo](https://avatars.githubusercontent.com/u/87897282?v=4)](https://github.com/SQKo "SQKo (2 commits)")[![Naneynonn](https://avatars.githubusercontent.com/u/42908112?v=4)](https://github.com/Naneynonn "Naneynonn (1 commits)")

---

Tags

discord

### Embed Badge

![Health badge](/badges/discord-interactions/health.svg)

```
[![Health](https://phpackages.com/badges/discord-interactions/health.svg)](https://phpackages.com/packages/discord-interactions)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

92437.3k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
