Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

verifyKey

Validates a payload from Discord against its signature and key.

function verifyKey(
rawBody:
| Uint8Array
| ArrayBuffer
| Buffer
| string
,
signature: string,
timestamp: string,
clientPublicKey: string | CryptoKey,
): Promise<boolean>;
§
verifyKey(rawBody: Uint8Array | ArrayBuffer | Buffer | string, signature: string, timestamp: string, clientPublicKey: string | CryptoKey): Promise<boolean>
[src]

§Parameters

§
rawBody: Uint8Array | ArrayBuffer | Buffer | string
[src]
  • The raw payload data
§
signature: string
[src]
  • The signature from the X-Signature-Ed25519 header
§
timestamp: string
[src]
  • The timestamp from the X-Signature-Timestamp header
§
clientPublicKey: string | CryptoKey
[src]
  • The public key from the Discord developer dashboard

§Return Type

§
Promise<boolean>
[src]

Whether or not validation was successful