Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
heyjorgedev committed Jul 16, 2024
1 parent 334adb5 commit 9658931
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ QStash is the message broker between your serverless apps. You send an HTTP
request to QStash, that includes a destination, a payload and optional settings.
We durably store your message and will deliver it to the destination API via
HTTP. In case the destination is not ready to receive the message, we will retry
the message later, to guarentee at-least-once delivery.
the message later, to guarantee at-least-once delivery.

## Installation

Expand Down Expand Up @@ -57,6 +57,25 @@ echo $message->getData();
echo $message->getData()->id;
```

## Receiver
When receiving a message from QStash, you should [verify the signature](https://upstash.com/docs/qstash/howto/signature). We have a class to help you with that:

```php
use HeyJorgeDev\QStash\QStash;

$receiver = QStash::receiver([
'QSTASH_CURRENT_SIGNING_KEY',
'QSTASH_NEXT_SIGNING_KEY',
]);

$result = $receiver->verify(
body: $request->getBody(),
signature: $request->getHeader('Upstash-Signature'),
url: $request->getUri(),
);

echo $result; // true or false
```
## Testing

```bash
Expand Down

0 comments on commit 9658931

Please sign in to comment.